Important: Please read the Qt Code of Conduct -

QWebkit + extracting dynamic DOM data

  • Hello!
    I am looking for decision for extracting calendar data from pages like this:

    There are js-widget + js-applet. And they load data and insert it to the html DOM. So when I try "inspect element" in firefox, I see, that they are loaded as pure html. Are there any functions in PySide to extract all completely finished DOM data?
    Or are there any functions to extract widgets result?
    Provide plz, if possible examples. Or tell some other way to manage issue.

  • This code prints iframe html content
    #include <QApplication>
    #include <QDebug>
    #include <QWebView>
    #include <QWebFrame>
    #include <QWebElement>
    #include <QTimer>
    int main(int argc, char *argv[])
    QApplication a(argc, argv);
    //Create browser
    QWebView w;;

    //Load page
    QEventLoop loop;
    //Wait for 5 seconds
    //Print contnt of frame
    return a.exec&#40;&#41;;


  • Thank you very much! I have been soiled about it for 2 weeks already on StackOverflow and here is simple and perfect answer!

  • You are welcome :)

Log in to reply