excel - Parse/Scrape from Multiple Pages using XMLHTTP in VBA -
the code below scrapes/parses 1 page of data (50 results) excel however, scrape multiple pages (500 results) - please help. (base64encode taken different source - don't take credit it)
`function getdata() boolean application.screenupdating = false dim objhttp new msxml2.xmlhttp dim strurl string dim strusername string dim strpassword string sheet1.range("a2:r2000") = "" sheet1.activate strusername = "user" strpassword = "password" = 1 ubound(myarray) strurl = "https://.ngx.com/ngxcs/indexprice.xml" objhttp.open "get", strurl, false objhttp.setrequestheader "authorization", "basic " & base64encode(strusername & ":" & strpassword) objhttp.setrequestheader "host", "secure.example.com" objhttp.setrequestheader "content-type", "text" objhttp.send "nothing" while objhttp.readystate <> 4 doevents wend dim strresponsereceived string strresponsereceived = objhttp.responsetext debug.print objhttp.responsetext msgbox strresponsereceived dim xdoc domdocument set xdoc = new domdocument xdoc.loadxml objhttp.responsetext`
'''''''''''''''''''''''''''''''''''''''''' rest of code outputs excel
thanks help!
Comments
Post a Comment