javascript - Collecting data from webpage with VBA -
i informations excel sheet webpage: http://www.livescore.in/
my code this:
dim page1 msxml2.xmlhttp60 dim html mshtml.htmldocument dim mydiv object set page1 = new msxml2.xmlhttp60 set html = new mshtml.htmldocument page1.open "get", "http://www.livescore.in", false page1.send until page1.readystate = 4 , page1.status = 200 doevents loop html.body.innerhtml = page1.responsetext set mydiv = html.getelementbyid("fscon") debug.print mydiv.innertext
i work in "fs" div in "fscon" div result of script "loading ..."
i know problem: when base page loading javascript fill "fscon" div. script sees base page (without data mathces)
my question how can wait until full page loading?
thanks
update: code working. uses ie object, test how fast scanning matches page.
dim ieapp internetexplorer dim iedoc object set ieapp = new internetexplorer ieapp.visible = false ieapp.navigate "http://www.livescore.in" while ieapp.busy: doevents: loop 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
Comments
Post a Comment