X posting from Excel topic
Trying to learn a little VBA and this is frustrating the hell out of me
Just looking to retrieve something from the HTML on a web page
Here is the Source
I want to retrieve the value $120
I'm trying this code
Public Sub GetWinningsDD()
Dim IE As New InternetExplorer
IE.Visible = False
IE.navigate "https://www.draftday.com/myGames.php"
Do
DoEvents
Loop Until IE.readyState = READYSTATE_COMPLETE
Dim Doc As HTMLDocument
Set Doc = IE.document
Dim sDD As String
sDD = Doc.getElementsByClassName("winning_value")(0).inn erText
Range("winnings_DD").Value = sDD
End Sub
But it keeps giving me an error
"Run time error 91
Object Variable or With Block variable not set"
With the debugger highlighting the sDD = Doc.getElementsByClassName("winning_value)(0).inne rText line as the problem
However when I change the class name to another class name in the source code, say "mygames", it returns the innerText for me with no problem. The weird thing is only some class names appear to work and some give me the error message above.
What is going on? Help anyone?
EDIT: for some reason innerText is showing up weird on the forum, it's not typed incorrectly FYI