QWebKit + XPath + HTML. Is it possible?
Вопрос
Is it possible to parse HTML (HTML/HTML5, not XHTML) pages using XPath and Qt classes of QWebkit (and probably other standard or Qt classes) without using any external utilities like tidy?
Thanks a lot!
Решение
No, obviously. XPath is for well-formed XML, which HTML is not (besides XHTML that you specifically excluded).
For accessing the DOM tree of a QtWebkit page, you have to use QtWebkit's QWebElement
api.
You can access the document element with
QWebElement QWebView::page()->mainFrame()->documentElement();
Не связан с StackOverflow