Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67527

Facing issue with extracting data from a website using VBA

$
0
0

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.


Viewing all articles
Browse latest Browse all 67527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>