Download Web Pages/Files -- Need Delay

M

MSweetG222

Hello All,

I am using the following code to download web pages and files from the
internet to a designated drive.
============

Private Declare Function URLDownloadToFileA Lib "urlmon" (ByVal pCaller As
Long, _
ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long


Private Function DownloadFile(URL As String, LocalFilename As String) As
Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFileA(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function

============

It works great. All sorts of web pages and files are downloaded to the
computer.

Here is where I am running into a snag. I am trying to download a web page.
If you manually navigate to this particular web page, the web page appears
to be querying a system, brings back data, and displays it as a table. This
takes a several seconds for the web page to produce this data. My code
(above) downloads the web page before it has had time to "refresh" with the
data.

Can someone point me to some code that would "refresh" the designated web
page and then wait until the data is brought back?

Thank you for your help.

MSweetG222
 
T

Tim Williams

It's possible that the page is being built dynamically in the browser:
if this is the case then you won't get the full page using your
current method.

You'd need to do something like automate IE to get that kind of
content. Google "automate IE" in gooogle groups and you'll get plenty
of examples, many of them from this group.
Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top