如何以最简单的方式从 html 页面中提取一些内容,例如所有父级为 p 且属于 A 类的强标签?等效的 xpath 将是 .//p[@class='A']/strong。
最佳答案
"The easiest way" is very, very debatable; is it easy enough for you to use QtWebkit to parse the page, and then use QWebFrame::findAllElements + a CSS2 selector to get what you want? (Or, you could inject jQuery and then use it to navigate the dom)
关于c++ - 用qt解析html?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16627725/