开发者

How to download the entire webpage

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜