Max Go
Max Go

Reputation: 2102

How to get html content of loaded URL into QML WebEngineView?

It seems WebEngineView doesn't provide possibility to access html content loaded by some URL. It looks like some related features are not yet implemented. 1 2

Upvotes: 0

Views: 2430

Answers (1)

WaltPurvis
WaltPurvis

Reputation: 1530

Currently you have to use JavaScript to get the html source. For example, this function will retrieve the html source and log it to the console:

function getSource(){
    var js = "document.documentElement.outerHTML";
    webview.runJavaScript(js, function(result){console.log(result);})
}

Upvotes: 3

Related Questions