Save html file from web site with out opening browser

Posted on 2004-09-21
Last Modified: 2010-05-02
ok i need to make an app that grabs a html page from a website and saves its to disk
the web site updates every few minutes
and i want my app to run in the background and grab this updated page every ... so often..
Question by:apinsonn
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 18

Assisted Solution

bobbit31 earned 75 total points
ID: 12113063
reference ms internet controls under project/references:

Dim IE As New InternetExplorer

IE.Navigate ""

'wait for page to load

Dim strHtml as string
strHtml = IE.document.body.innerHTML

msgbox strHtml

Dim ff as integer
ff = FreeFile

Open "<path to file>" For Output as #ff
Print #ff, strHtml
LVL 18

Expert Comment

ID: 12113065
and put the above in a timer
LVL 18

Expert Comment

ID: 12113109
oh and don't forget to clear resources:

set IE = nothing

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

LVL 32

Accepted Solution

Erick37 earned 75 total points
ID: 12113254
You can use the URLDownloadToFile API

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

Use like this:

returnValue = URLDownloadToFile(0, "", "c:\ms.htm", 0, 0)

How To Download a File Without Prompting;en-us;244757

LVL 52

Expert Comment

by:Ryan Chong
ID: 12113320
Also Ensuring URLDownloadToFile Bypasses a Cached File Copy:

Author Comment

ID: 12113473
both work great split the points

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question