HTML parser example, anybody?

Oleg Broytmann phd at
Fri Apr 28 04:18:08 EDT 2000

On 27 Apr 2000, Gerhard Haering wrote:
> I want to transform my own HTML templates (with a few template tags,
> special comments, and so on) into final HTML for the browser. I would like

   I'd recommend you to use DocumentTemplate (ZTemplates from

> to use Pyhton's htmllib, but from the docs I can get no clue on how to get
> it done. I seem to have to use a writer and a formatter class ... 

   Do not use HTMLLib, it is designed for formatting text representation of
HTML. Use SGMLLib instead.

> I would greatly appreciate an example of HTML -> HTML using
> htmllib/sgmllib. Can anybody provide pointers/code snippets?

   Cannot show HTML->HTML, but can show HTML parsing with SGMLLib. Look
into my project "Bookmarks database and Internet robot". There is a parser
for bookmarks.html - one of the parsers I wrote so many times.

   Master site:

   Faster mirrors:

Oleg.            (All opinions are mine and not of my employer)
    Oleg Broytmann      Foundation for Effective Policies      phd at
           Programmers don't die, they just GOSUB without RETURN.

More information about the Python-list mailing list