Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Russell Hill
  Where is Russell Hill?
 Sydney
 Australia
 Russell Hill
 Tags
Subject: Accessing web pages
Thread ID: 289354 Message ID: 289354 # Views: 72 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Friday, December 31, 2010 5:24:34 AM         
   


Hi all,

When I use an IE object to examine a given web page (as below),

webPage = some_url
oWeb = CreateObject("InternetExplorer.Application")
oWeb.Navigate2(webPage)

I use the .ReadyState property of the IE object (as below) to deal with the wait while the web page is accessed.

DO WHILE oWeb.ReadyState # 4
   FOR loop=1 TO 1000
   ENDFOR
ENDDO
webString = oWeb.Document.Body.innerHTML


How can I deal with the potentially slow loading of the web page when I use the URLDownloadToFile function (as below) instead of the IE object?

DECLARE INTEGER URLDownloadToFile ;
     IN URLMON.DLL ; 
INTEGER pCaller, ;
 STRING szURL, ;
 STRING szFileName, ; 
INTEGER dwReserved, ;
INTEGER lpfnCB

webPage = some_url
txtFile = some_result_text_file

urlCall = URLDownloadToFile( 0, webPage, txtFile, 0, 0 )

As an aside, what is the superior method of the two to "read" HTML source code?

Cheers and a Happy New Year,

Russell.

ENTIRE THREAD

Accessing web pages Posted by Russell Hill @ 12/31/2010 5:24:34 AM
RE: Accessing web pages Posted by claude fox @ 12/31/2010 6:38:54 AM
RE: Accessing web pages Posted by Russell Hill @ 1/1/2011 6:39:05 AM