Automatically download and save pdf files from a website.
Is there a way to do this?
I would like to automate a daily procedure for downloading and saving a
couple of dozen pdf from several websites. Currently I have saved bookmarks
in a browser and manually open and save each one.
Some of the files have direct addresses, for example:
https://www.somewebsite.com/resource...rice_sheet.pdf
Some are dynamically generated, for example:
https://www.somewebsite.com/resource...te=MA&type=wsl
(this returns a pdf file to the browser)
I can get the directly addressed documents with some simple scripting of an
FTP client. It's the dynamically generated files that I'm having a hard time
figuring out. The only way I've been able to get the dymamically generated
files seems to be to request the url through a browser.
(Windows XP pro, ie 6.0, Acrobat Reader 7.0.0, VB.NET 2003)
Dim ieApp As SHDocVw.InternetExplorer = New SHDocVw.InternetExplorer
Dim sURL as String = "URL of file I want"
ieApp.Navigate(sURL)
This seems to work fine. Launches a browser, navigates to the URL, browser
invokes Acrobat, pdf document is displayed.
The two problems I don't know how to solve are:
1) Determining when the pdf document has finished downloading.
2) Saving it.
Thanks.
Mike