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
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,
Re: How to save webpage in QT webkit as “save as complete webpageâ€
do some one know how to do it, please!
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 -
Code:
void QNAMProxy::HandleFinished( QNetworkReply* reply ) {
if( reply->error( )) {
// Something went wrong
} else {
QUrl url
= reply
->url
( );
//TODO Parse the URL to create your local path
QFile file( "Parsed local file name" );
// Some problem with creating the file to write
} else {
file.write( reply->readAll( ));
file.close( );
}
}
}
This should give you the basis of what you need.
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
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.