问题描述
我一直在写一些代码从一些页面中获取一些数据在Java和Jsoup是最好的库使用。但是,不幸的是,我必须将整个代码移植到C / C ++。但我不能找到任何体面的html解析器使用c ++。有没有任何Jsoup像C ++的库或如何可以实现类似的结果?
I have been writing some codes to get some data from some pages in Java and Jsoup was on of the best libraries to work with. But, Unfortunately I have to port the whole code to C/C++. But I a cannot find any decent html parser to use on c++. Is there any Jsoup like library for C++ or How can similar results be achieved?
[目前我正在使用Curl获取页面的源和漫游互联网找到一个html解析器]
[Currently I am using Curl to get the source of the pages and roaming the internet to find a html parser]
推荐答案
不幸的是,我想没有解析器如Jsoup for C ++ ...
Unfortunately, i guess there's no parser like Jsoup for C++ ...
除了这里已经提到的库,还有一个关于C ++(一些C太)解析器的好概述:
Beside the libraries which are already mentioned here, there's a good overview about C++ (some C too) parser here: Free C or C++ XML Parser Libraries
对于解析我使用(Html-)DOM解析;它是一个非常小的(只有2个文件)库,可在大多数操作系统(甚至非桌面操作系统)上运行。
For parsing i used TinyXML-2 for (Html-) DOM parsing; it's a very small (only 2 files) library that runs on most OS (even non-desktop).
- 推送解析器
- 验证
- XPath和XPointer支持
- 跨平台/良好文档
- push and pull parser (DOM, SAX)
- Validation
- XPath and XPointer support
- Cross-Plattform / good documentation
- 推送解析器(DOM,SAX)
- 验证
- 没有XPath支持(但是包含这个?)
- 跨平台/良好文档
- push and pull parser (DOM, SAX)
- Validation
- No XPath support (but a package for this?)
- Cross-Plattform / good documentation
如果您使用的是C ++ CLI,请查看 - .NET的Jsoup端口。
If you are on C++ CLI, check out NSoup - a Jsoup port for .NET.
更多:
- (?)
- (DOM / XPath和Unicode支持)
- (CSS Parser)/ (DOM)(但是,在C中)
- (用于C ++的CSS选择器引擎)
- htmlcxx - html and css APIs for C++
- MSHTML (?)
- pugixml (DOM / XPath and Unicode support)
- LibCSS (CSS Parser) / LibDOM (DOM) (however, both in C)
- hcxselect (CSS selector engine for C++)
Model / Parser和CSS选择器?
Maybe you can combine a DOM Model / Parser and a CSS selector together?
这篇关于Jsoup喜欢html解析器的C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!