Hello everybody,

I've been trying to get an element of a web page, but I've been failing to actually get the element that I want. I am new to web scraping in VBA so I'm not really sure how to do it properly.

I'll briefly explain my code: In column A of the sheet "Ventas" I have a list of dates, I used Len, InStr and Split to get the different elements (day, month, year) since the web page's URL changes accordingly. I'll paste the link to the website since it's a public website in Mexico. The elements in blue are the different variable elements, these elements will change depending on the date of column A in the sheet "Ventas".
(i.e. http://www.diariooficial.gob.mx/indi...or=158&dfecha=10%2F07%2F2020&hfecha=10%2F07%2F2020

Next I am trying to get er as the exchange rate that resulted from the search and display it in a Msgbox. I keep getting an error on the er line, so I'm guessing I am not getting the element properly. I'll paste a snapshot of the relevant HTML code referring to the element I am trying to extract from the webpage. Captura.JPG

Any help is greatly appreciated. Thanks a lot in advance!

Please Login or Register  to view this content.