I would like to get some informations into an excel sheet from this webpage: http://www.livescore.in/
My code look like this:
Dim page1 As MSXML2.XMLHTTP60
Dim html As MSHTML.HTMLDocument
Dim myDiv As Object
Set page1 = New MSXML2.XMLHTTP60
Set html = New MSHTML.HTMLDocument
page1.Open "GET", "http://www.livescore.in", False
page1.send
Do Until page1.readyState = 4 And page1.Status = 200
DoEvents
Loop
html.body.innerHTML = page1.responseText
Set myDiv = html.getElementById("fscon")
Debug.Print myDiv.innerText
I would like to work in the "fs" div which is in the "fscon" div The result of this script is "Loading ..."
I know what is the problem: When the base page is loading some javascript will fill up the "fscon" div. My script is only sees the base page (without the data mathces)
My question is how can I wait until the full page is loading?
Thanks
Update: This code is working. It uses IE object, i will test how fast is scanning all the matches from the page.
Dim ieApp As InternetExplorer
Dim ieDoc As Object
Set ieApp = New InternetExplorer
ieApp.Visible = False
ieApp.navigate "http://www.livescore.in"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.document
Debug.Print ieDoc.all.Item("fscon").innerText
Set ieDoc = Nothing
ieApp.Quit
Set ieApp = Nothing