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]");
    
    ui->webView_2->setHtml(player.toPlainText());
    

    @

    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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.