开发者

How to download the entire webpage

开发者 https://www.devze.com 2022-12-09 21:00 出处:网络
Is there any sample application source which download the entire web-page in windows mobile.. I mean,in desktop when i d开发者_StackOverflowo save as,entire webpgae gets saved.Same wayi want it to be

Is there any sample application source which download the entire web-page in windows mobile.. I mean,in desktop when i d开发者_StackOverflowo save as,entire webpgae gets saved.Same way i want it to be in windows mobile..

Thanks.


No, I can't provide sample code, but I guess you'd have to parse the HTML file for included other files and download these as well. As you're only talking about images, I'd try to following for a start:

  1. Download HTML file
  2. Look for <img> tags and parse these for the picture file name
  3. For all the picture file names: download these as well

Please note that this does not yet include background images through CSS.


If you are looking to download the mobile-version of a webpage, use HTTrack and set the agent string to a mobile device, such as the following:

Opera/9.50 (J2ME/MIDP; Opera Mini/4.0.10031/298; U; en)

If you are trying to save the content of a page to your mobile device for offline browsing, you'll need to scrape the page yourself. There are some libraries out there for dealing with HTML in C# (like Html Agility Pack), but I'm not sure if they are compatible with the compact framework.


I don't have the source code anymore but in the past I have used libcurl for Windows mobile, it is quite easy to use it to download anything http and ftp and of course 'src's of , and and href of .

0

精彩评论

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