jamescooper
Well-known Member
- Joined
- Sep 8, 2014
- Messages
- 840
I am getting error code 91 on the line
Any reason please? Thanks.
Code:
ActiveWorkbook.Sheets("Sheet1").Range("A1").Value = holdingsClass(0).textContent
Any reason please? Thanks.
Code:
Sub Pull_Data()
Dim IE As InternetExplorer
Dim html As HTMLDocument
Set IE = New InternetExplorer
IE.Visible = False
IE.navigate "http://greyhoundbet.racingpost.com/#meeting-list/view=time&r_date=2018-02-16"
'Wait until IE is done loading page
Do While IE.readyState <> READYSTATE_COMPLETE
DoEvents
Loop
'Get Data
Set html = IE.document
Set holdingsClass = html.getElementsByClassName("appList raceList raceListTime")
ActiveWorkbook.Sheets("Sheet1").Range("A1").Value = holdingsClass(0).textContent
'Quit and clean
IE.Quit
Set IE = Nothing
End Sub