I am trying to scrape the exchange rate of the COP to the USD into Cell A1 of Sheet 1 in my Workbook. I need to pull rate from the following website:
When I inspect the element on the website I get the following: div class="up-big"> a href="/estadisticas/trm" target="_blank" style="color:#FFF;">3.452,67
I have tried to reference the class "up-big" but believe I am running into issues because the class is nested.
I have been troubleshooting the following code:
Public Sub GetInfo()
Dim Loc As Range
Dim TxtRng As Range
Dim element As Variant
Dim elements As Object
Dim V As Variant
Dim appIE As Object
Set appIE = CreateObject("internetexplorer.application")
With appIE
.navigate "https://www.banrep.gov.co"
.Visible = True
End With
Do While appIE.Busy
DoEvents
Loop
Set TxtRng = Sheets("Sheet1").Range("A1")
Set elements = appIE.document.Tables("ViewTable ResultsTable GreenBar").elements("up-big")
For Each element In elements
TxtRng = element.innerText
Next element
appIE.Quit
Set appIE = Nothing
' Set elements = HTMLDoc.getElementsById("up-big")
End Sub
I am hoping someone can point me in the right direction. Thank you.