Results 1 to 6 of 6

Thread: How to save webpage in QT webkit as “save as complete webpage”

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2010
    Posts
    6
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Symbian S60

    Default How to save webpage in QT webkit as “save as complete webpage”

    Hello,

    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, maintaining 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 need to do it using standard DOM and QWebElement.

    Please provide me some inputs on this.

    Thanks

  2. #2
    Join Date
    Jun 2010
    Posts
    6
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Symbian S60

    Default Re: How to save webpage in QT webkit as “save as complete webpage”

    Hello,

    I need to move this thread to "Qt Programming". How to do that?

    Thanks,

  3. #3
    Join Date
    Feb 2011
    Posts
    55
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to save webpage in QT webkit as “save as complete webpage”

    do some one know how to do it, please!

  4. #4
    Join Date
    Jun 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to save webpage in QT webkit as “save as complete webpage”

    I don't know if this thread is still active but I stumbled upon it while looking for answers for a QtWebkit problem I'm facing. Anyway...

    I would go about this by using my own QNetworkAccessManager based class. Create a slot function that is connected to the finished signal from that class. I haven't tested this theory, but it should be something along the lines of -

    Qt Code:
    1. void QNAMProxy::HandleFinished( QNetworkReply* reply ) {
    2. if( reply->error( )) {
    3. // Something went wrong
    4. } else {
    5. QUrl url = reply->url( );
    6. //TODO Parse the URL to create your local path
    7. QFile file( "Parsed local file name" );
    8. if (!file.open(QIODevice::WriteOnly)) {
    9. // Some problem with creating the file to write
    10. } else {
    11. file.write( reply->readAll( ));
    12. file.close( );
    13. }
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 
    This should give you the basis of what you need.

  5. #5
    Join Date
    May 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to save webpage in QT webkit as “save as complete webpage”

    If you want to save the page as html

    webPage->currentFrame()->toHtml() => QString
    Last edited by prabhakaran; 3rd October 2011 at 11:19.

  6. #6
    Join Date
    Oct 2011
    Location
    Brazil, SC.
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to save webpage in QT webkit as “save as complete webpage”

    prabhakaran; I don't see this function "toHtml", have I missed something?
    I want to get the page's html and that's it.

Similar Threads

  1. qt gui application on webpage
    By bcheruk in forum Qt Programming
    Replies: 4
    Last Post: 23rd April 2009, 21:03
  2. opening webpage using qt....
    By anupamgee in forum Qt Programming
    Replies: 8
    Last Post: 20th April 2009, 12:13
  3. Can't get webpage to open using 'QHttp'
    By rishiraj in forum Newbie
    Replies: 6
    Last Post: 30th January 2009, 11:24
  4. is it possible to save a webpage as an image?
    By billconan in forum Qt Programming
    Replies: 2
    Last Post: 8th July 2008, 02:08

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.