[Qt-interest] how to get the all the text in QWebView

go canal gocanal at yahoo.com
Mon Oct 4 07:47:04 CEST 2010


thank you so much Andre, I will try that.
 thanks,
canal




________________________________
From: Andre Somers <andre at familiesomers.nl>
To: qt-interest at trolltech.com
Sent: Sun, October 3, 2010 4:47:20 PM
Subject: Re: [Qt-interest] how to get the all the text in QWebView

 Op 2-10-2010 2:34, go canal schreef: 
Hi,
>is there a method to get the whole html content of a             QWebView ? Like 
>'view source' of other browsers.
>
>
>from QWebPage, we can get mainFrame and currentFrame,             then using 
>toHtml() to get the html content of a frame.             However, what if the 
>web page has multiple frames ? How do I             iterate all the frames ? 
>Better still if there is one single             method to get all the content of 
> the web page. 
>
>
You were on the right track. There is no meaningful way to return     one single 
html source if there are multiple frames. So indeed you     need to iterate to 
get the source from all the frames. Lucky for     you, QWebFrame has a 
childFrames() method that will return a QList     of frames. Simply iterate over 
them recursively and you get all your     frames.

André



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101003/fe7a6c7a/attachment.html 


More information about the Qt-interest-old mailing list