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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How could I have my prg go grab the source code of a website? 1

Status
Not open for further replies.

tristero

Programmer
Jan 24, 2003
95
0
0
US
Is there a simple way to fetch a html file from the web and turn it into a string? like FILETOSTR() but with a url.
 
tristero

Look at FAQ184-3447

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I used to do this a few years ago. I used vb instead of fox, but you could use the low-level file functions to do the same. I would have the vb browser get the page, then save the page as text. Then I would open the file as a text file and parse the file line by line until I achieved the desired result. (The format of the page I was copying was pretty much the same every time, with only data changes.) Then I moved all of my copied data into a Jet database that I re-uploaded to the web.

We did this to copy the winners and track data from various horse & dog racing sites around the country and post them to our own website.
 
Hi,
You may try this

oIE = CreateObject("InternetExplorer.Application")
lcURL="oIE.Navigate(lcURL)
lcInnerHtml = oIE.Document.Body.InnerHtml

* lcInnerHTML contains webpage source
 
Try this code and add the FILETOSTR() function to save it as a file:

WAIT WINDOW "Retrieving Data..." NOWAIT
lcURL="
objHTTP = CreateObject("MSXML2.XMLHTTP")
objHTTP.Open("GET", lcURL, .f.)
objHTTP.Send
lcHTML=(objHTTP.ResponseText)

* this will display part of it, but its all there.
MESSAGEBOX(lcHTML)

Jim Osieczonek
Delta Business Group, LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top