Retrieving HTML From Website, Parsing, Then importing - Whats the best way?

tembenite

Registered User.
Local time
Yesterday, 23:20
Joined
Feb 10, 2005
Messages
38
I've searched for this, but I must not have the right search terms.

I am looking for a way to load the contents of a website as a string, into my VBA so I can parse it for the information I need.

I have been using:
Code:
Function getWebPage(strURL As String) As String
    Dim XML As MSXML2.XMLHTTP
    Set XML = New MSXML2.XMLHTTP
    On Error GoTo daEND
    getWebPage = ""
    XML.Open "GET", strURL, False
    XML.send
    getWebPage = XML.responseText
daEND:
End Function

For whatever reason when I look at the source that is pulled from this request, it is different from the sourcecode of the website when loaded in IE. The table of information I need, is one of the items that is missing.

Is there another good way to load the contents of a website into a string in VBA, that might bring better results (or simply different results)? (Perhaps in a way where I can specify a User Agent, so I can "look" like IE?) Thanks.

:confused:
 
Not sure how to do what you want but have you looked at
"ImportXML Method" in help

Peter
 

Users who are viewing this thread

Back
Top Bottom