Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connect to a website

Status
Not open for further replies.

spydermonkey

Programmer
May 24, 2004
31
US
Can someone lead me to a tutorial on how to parse a website?

Virtually take a URL and print back the source code?

I'm rather knew to VB6.

Thanks.
 
look into using the winsock control or the Microsoft Internet Controls.
 
You should use the XMLHTTP reference which you should be able to download from Microsoft.

Here's an example about how to use it:

Public Function SendCommand(URLCommand) As String
Dim HttpReq As New MSXML2.XMLHTTP40
HttpReq.Open "GET", URLCommand, False

HttpReq.send
SendCommand = HttpReq.responseText
End Function

You just need to pass the url as a the URLCommand parameter and the function will return the source code.
If the source code is dynamic (such as an ASP page) you will need to also pass a random value querystring parameter together with the URL. Otherwise it will always give you the same source code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top