[webkit-qt] get page content

周鹏 zhoupeng19 at 126.com
Tue Mar 8 01:06:25 PST 2011

    I want to get the page content after all external resource is loaded,but i don't want to call the QApplication::exec() function,is it possible(because this function open a window,but i don't need it,all i want is the content of the page)?this is my code:

class View : public QWebView
    View(QWidget *parent = 0); 
private slots:
    void loadFinished(bool ok);
View::View(QWidget *parent) : QWebView(parent)
    connect(this, SIGNAL(loadFinished(bool)), SLOT(loadFinished(bool)));
void View::loadFinished(bool ok)
    QWebFrame *frame = page()->mainFrame();
    qDebug() << frame->toHtml();//output
int main(int argc, char *argv[])
    QApplication app(argc, argv);   
    View view;
    return app.exec();

In other words,i want to delete the last line of code in main function,but i need the program work correctly,is it possible?If yes,how can i do it?

        Zhou Peng
        zhoupeng19 at 126.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20110308/0012644c/attachment.html>

More information about the webkit-qt mailing list