Automating Internet Explorer
This quick example shows how to automate Internet Explorer. In this example, I just pop up IE and navigate to a particular page, and then write the page’s HTML content out to a local file.
- '
- ' ScriptingAnswers.com Essentials - by Don Jones
- '
- ' Automate IE example
- ' This shows how to automate IE to navigate to a Web
- ' page and then save the body of the page into an HTML
- ' file
- Dim objIE, objFSO, objTS
- Set objIE = CreateObject("InternetExplorer.Application")
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- objIE.Navigate("http://www.scriptinganswers.com")
- Do While objIE.Busy
- WScript.Sleep 500
- Loop
- Set objTS = objFSO.CreateTextFile("C:\WebPage.html")
- objTS.Write objIE.Document.Body.InnerHTML
- objTS.Close
Tags: automate, ie, internet explorer, navigate, VBScript Scripts, web browser










