I need to extract COCOA London Dec20 and Mar21 close price from following website https://www.mrci.com/ohlc/ohlc-all.phpScreenshot for the website
I wrote the following code for this but it's throwing errors, please help:
Sub extract()
Dim appIE As Object
Set appIE = CreateObject("internetexplorer.application")
With appIE
.Navigate "https://www.mrci.com/ohlc/ohlc-all.php"
.Visible = False
End With
Do While appIE.Busy
DoEvents
Loop
Set allRowOfData = appIE.document.getElementsByClassName("strat").getElementsByTagName("tbody")(183)
Dim myValue As String: myValue = allRowOfData.Cells(5).innerHTML
appIE.Quit
Set appIE = Nothing
lastrow = Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Row + 1
Range("A"& lastrow).Value = myValue
End Sub
- The code is trowing following error:
Run-Time Error - 438 Object doesn't support the property or method.