Roy
Roy

Reputation: 438

light weight HTML Parser for translating to formatted text?

I'm finding light weight HTML Parser for translating to formatted text. for example:

<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>&nbsp;</td><td>cell b</td></tr><tr><td>cell c</td><td>cell d</td><td>cell e</td></tr><table>

</body>
</html>

into:

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

using xml/xslt libraries are overkill for that.

Upvotes: 3

Views: 471

Answers (2)

Roy
Roy

Reputation: 438

I finally choosed htmlcxx for this issue. It is lightweight enough.

Upvotes: 0

schnaader
schnaader

Reputation: 49719

You could have a look at the source of an open source text browser (f.e. lynx).

Upvotes: 1

Related Questions