开发者

Find file Links in HTML page and automatically download the files

开发者 https://www.devze.com 2023-02-06 09:32 出处:网络
I have to download hundreds of files that are represented by \"<a href:\"FileUrl\"... />\" within several web pages.

I have to download hundreds of files that are represented by "<a href:"FileUrl"... />" within several web pages.

I try to build a .NET program with a .NET Webbrowser control, open a URL (the page containing the links), extract the document's source code, find the links... All this is eezy peezy, no problem.

Now once I've found a link and I instruct the webbrowser to navigate to that file lin开发者_如何转开发k, I'm presented with a dialog to save the file (or open it) etc.

For one or two files that's fine. For hundreds, I need to make the process automatic.

Besides, when I open the link with Firefox, the content of the file (textfile) is DISPLAYED within the browser, not DOWNLOADED, which could be fine for me, because then I could read the "source" (ie the file content in text format) and save it to disk as a file.

Any clue? Or maybe there is some existing utility that does the job?


Found it!

A really neat .NET HTTP downloader class written in VB. Only issue is its written in french (But I'm French mind you... :-).

Here it is:

http://www.vbfrance.com/codes/NET2-CLASSE-TELECHARGEMENT-HTTP-AVEC-GESTION-RESUME-PROGRESSION_41850.aspx

With a few tweaking, you can arrange the samplehttp downloader program to silently download all passed file url's, and even manage progresses through some progress event.

The class can optionnally manage user credentials and resume interrupted large file download.

0

精彩评论

暂无评论...
验证码 换一张
取 消