How can I save a web page to file using VBS 
Author Message
 How can I save a web page to file using VBS

Im quite new to VBS and I was wondering how to
programaticly have my script when it is run atuomaticly
jump to a HyperLink and than save that web page to 2 files
an html file and a Text file

Please Help
Thanx
Dan



Sun, 12 Dec 2004 03:25:40 GMT  
 How can I save a web page to file using VBS
fWrite "c:\temp\yahoo.txt", WebText("http://www.yahoo.com")
fWrite  "c:\temp\yahoo.html", WebHTML("http://www.yahoo.com")

Function WebText(sUrl)
 Set IE = createobject("InternetExplorer.Application")
 IE.Navigate sUrl
 Do Until IE.ReadyState = 4:WScript.Sleep 10 : Loop
 WebText = IE.Document.Body.InnerText
 IE.Quit
End Function

Function WebHTML(sUrl)
 Set IE = createobject("InternetExplorer.Application")
 IE.Navigate sUrl
 Do Until IE.ReadyState = 4:WScript.Sleep 10 : Loop
 WebHTML = IE.Document.Body.InnerHTML
 IE.Quit
End Function

Sub fWrite(FilePath, sData)
 'Given the path to a file, will return entire contents
 With CreateObject("Scripting.FileSystemObject")._
  OpenTextFile(FilePath, 2, True)
  .Write sData: .Close
 End With
End Sub

Quote:
> Im quite new to VBS and I was wondering how to
> programaticly have my script when it is run atuomaticly
> jump to a HyperLink and than save that web page to 2 files
> an html file and a Text file

> Please Help
> Thanx
> Dan



Sun, 12 Dec 2004 04:07:48 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Saving Excel file from the Web using VBS

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

3. Passing variables from one web page to another web page using JavaScript

4. How can I save a file in another web server using ABCUpload

5. schedule view web page and save data to file

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

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

8. Saving a web page to file

9. How To Fill In An HTML Form On A Web Page Using A Standalone .VBS Script

10. saving an excel file using VBS

11. Saving web pages to file using webBrowser or inet control

12. download/save web page

 

 
Powered by phpBB® Forum Software