Important: Please read the Qt Code of Conduct -

Get DOM (elemenet) content

  • How to get the content (HTML) of an element of a QWebView?

    QWebElement document = ui->webView->page()->mainFrame()->documentElement();

    QWebElement player = document.findFirst("div[id=player]");


    Don't work!

  • The HTML content is returned by QWebElement::toInnerXml()

    Is that code executed after the page is fully loaded (in a slot connected to the signal QWebView::loadFinished(bool))?

Log in to reply