QWebEngine 中 QWebElement 和 QWebElementCollection 的等价物

Equivalent of QWebElement and QWebElementCollection in QWebEngine

我想从 QWebView 切换到 QWebEngine 以便能够使用最新的 Qt 版本。我用 findAllElements and so on to get the QWebElements and for example toPlainText() 来获取它的文本。

我在 QWebEngine 中找不到类似的东西。我现在必须将 jQuery 或 AngularJS 与 runJavascript 一起使用吗?或者我可以使用 C++/Qt 中的某些东西吗?我真的很想避免JS。

Qt WebEngine 中没有等效项。要访问这些元素,您应该从现在开始使用 JavaScript。据说here:

In Qt WebEngine, frame handling has been merged into the QWebEnginePage class. All child frames are now considered part of the content, and only accessible through JavaScript. Methods of the QWebFrame class, such as load() are now available directly through the QWebEnginePage itself.