HTML parser example, anybody?

Oleg Broytmann phd at phd.russ.ru
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 www.zope.org)
instead.

> 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: http://sun.med.ru/~phd/Software/Python/#bookmarks_db

   Faster mirrors: http://skyscraper.fortunecity.com/unix/797/Software/Python/#bookmarks_db
   http://members.xoom.com/_XMCM/phd2.1/Software/Python/index.html#bookmarks_db

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





More information about the Python-list mailing list