开发者

How to save webpage in Qt WebKit as "save as complete webpage"

开发者 https://www.devze.com 2023-01-02 06:50 出处:网络
I need to save web page using Qt WebKit similar to \"Save as complete webpage\". Following are my requirements,

I need to save web page using Qt WebKit similar to "Save as complete webpage".

Following are my requirements,

  1. Save the index html file, mainta开发者_开发问答ining entity encoding.
  2. Need to download all linked images and other resources.
  3. Need to change resource path in html page to local downloaded path.
  4. Need to maintain webpage current state.

I can use Qt and JavaScript to do this.

Please provide me some inputs on this.

Thanks


You could use a HTML parser to parse the current page, then look for all the images (xpath "//img"), download their files, and change their src attributes.


how about save the html to local system and call setHtml() when you need it?

0

精彩评论

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