qthttpqwebviewqwebpage

How can I manage QWebView contents in Qt?


I have a QWebView object loading a web page. I need to save a picture from the page to the memory. The URL of the picture is dynamic, but it follows a regexp.

How do I do that with QWebView?


Solution

  • Sure, you can't save image with QWebView. But you might be interested in QWebFrame::toHtml, using which you can obtain all the content in HTML.
    Then you need to regexp to obtain image URL, fetch it, and finally save it. Solution is here.