Save multiple webpages

This script loads in IE different webpages and for each saves in an incremental filename the full content of the webpage.

You can find the corresponding script file under Script_Examples, sub-directory of scripts.

 

Dim link$(100)

 

'Here insert all the url names to load in IE and so then save the full webpage.

'Array link$ can be initialized manually, for example

'link$(0)="www.wintask.com"

'link$(1)="www.google.com"

'etc.

'or you can put all the links in an Excel file and use ReadExcel

'ReadExcel(excelfilename$,"A1:A20",link$())

 

'Start Internet Explorer

StartBrowser("IE")

 

'loop for loading an url which is in the array link$ and saving the full Web page

'under a filename incrementing.

 

'nb is the number of urls to process

nb=20

 

'filename$ is the full path for storing the full webpage.

filename$="c:\wttest\file"

 

i=0

repeat

page$=link$(i)

navigate(page$,200)

 

'here the statements for saving the page - we use menu shortcuts within IE

usewindow(top$())

SendKeys("<Alt f>")

pause 1 ticks

sendkeys("a")
'Under Vista, the Save Web Page window name is as below
UseWindow("IEUSER.EXE|#32770|Save Webpage")
'Under XP the window name is as below
'UseWindow("IEXPLORE.EXE|Edit|Save Web Page|1")

SendKeys(filename$+str$(i))

Sendkeys("<Enter>")

pause 2

i=i+1

until i=nb