c++ - 用qt解析html?

标签 c++ html xml qt xpath

如何以最简单的方式从 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/

相关文章:

c# - .NET 反序列化后 XML 中的对象位置(行、列)

c++ - 将指针存储在具有不同访问方法的多个容器中是不可取的吗?

c++ - 使用 SSL 通配符证书验证主机

c++ - 为什么我得到的是零?

javascript - 替换nbsp;和带有空白的 HTML 标签

html - 选择选项的 CSS 为透明背景

c++ - 在 C++ 中操作成对 vector 的值之一

javascript - jquery:如何使用onchange更新输入值?

java - 忽略 JAXB 中的根元素

java - 如何向上转换和使用子特定方法