C++ 用于转换为格式化文本的轻量级HTML解析器?
我正在寻找用于转换为格式化文本的轻量级HTML解析器。例如:C++ 用于转换为格式化文本的轻量级HTML解析器?,c++,html,text,C++,Html,Text,我正在寻找用于转换为格式化文本的轻量级HTML解析器。例如: <html> <body> <a href="http://www.google.com/">Google</a> <img src="http://images.google.com/intl/en_us/images/logos/images_logo.gif" alt="Google image logo" /> <ol> <li>first&l
<html>
<body>
<a href="http://www.google.com/">Google</a>
<img src="http://images.google.com/intl/en_us/images/logos/images_logo.gif" alt="Google image logo" />
<ol>
<li>first</li>
<li>second</li>
</ol>
<ul>
<li>apple</li>
<li>orange</li>
</ul>
<table><tr><td>cell a</td><td> </td><td>cell b</td></tr><tr><td>cell c</td><td>cell d</td><td>cell e</td></tr><table>
</body>
</html>
使用xml/xslt库在这方面做得太过火了。您可以看看开源文本浏览器(f.e.lynx)的源代码。我最后选择了htmlcxx作为本期的主题。它足够轻了
Google (link:http://www.google.com/) (img:Google images logo)
1. first
2. second
- apple
- orange
cell a(tab) (tab)cell b
cell c(tab)cell d(tab)cell e