Saving a web page to file 
Author Message
 Saving a web page to file

I need to be able to pull a web page from the Internet and dump it to
a local file. Needs to be done from a CScript, e.g. from the command
line:

C:\Goose>cscript getpage.vbs http://www.*-*-*.com/ > page.htm

There is a GNU program out there called wget that does this, and I am
using it now by calling

        WshShell.run "%comspec% /c wget " & webPage & " -O page.htm"

but was wondering if there was a way of doing it without using an
external program?

--
Goose



Tue, 06 May 2003 03:00:00 GMT  
 Saving a web page to file
Deja.com: Power Search
http://www.deja.com/home_ps.shtml

keywords: xmlhttp
forum: microsoft.public.scripting.*

--
Michael Harris
Microsoft.MVP.Scripting
--

Quote:

> I need to be able to pull a web page from the Internet and dump it to
> a local file. Needs to be done from a CScript, e.g. from the command
> line:

> C:\Goose>cscript getpage.vbs http://www.altavista.com > page.htm

> There is a GNU program out there called wget that does this, and I am
> using it now by calling

> WshShell.run "%comspec% /c wget " & webPage & " -O page.htm"

> but was wondering if there was a way of doing it without using an
> external program?

> --
> Goose



Tue, 06 May 2003 03:00:00 GMT  
 Saving a web page to file
On Fri, 17 Nov 2000 13:55:33 -0800, "Michael Harris"

Quote:

> Deja.com: Power Search
> http://www.deja.com/home_ps.shtml

> keywords: xmlhttp
> forum: microsoft.public.scripting.*

Thanks again Michael.

For the lurkers who are too lazy to search, here is how to save a web
page to a file:

With CreateObject("microsoft.xmlHTTP")
   .open "GET", "http://www.altavista.com", False
   .send
   WriteToFile .responseText, "page.htm"
End With

Sub WriteToFile(text, file)
   With CreateObject("Scripting.FileSystemObject")
      With .CreateTextFile(file, True)
         .Write text
         .Close
      End With
   End With
End Sub



Tue, 06 May 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How can I save a web page to file using VBS

2. How can I save web page to file with VBS

3. schedule view web page and save data to file

4. WSH Script to save a web page as a text file - dialogue box problem

5. Saving as a file a web page accessed via a form (doesn't work)

6. download/save web page

7. Question about filenames and the save as dialog from a web page

8. Saving web pages on local system

9. Saving Info to the Client Clipboard from a Web Page

10. saving passwords on web page logins

11. How to save a web page to disk?

12. Save as web page

 

 
Powered by phpBB® Forum Software