HTML -> text/plain "clever" formatting

Karl Scalet news at yebu.de
Mon Oct 6 06:34:41 EDT 2003


Gilles Lenfant wrote:
> Hi,
> 
> I make an app where I need to convert HTML to text in a "clever" way (means
> it tries to mimic when possible a browser rendering).
> Actually I spawn with popen2 a "lynx" that makes a perfect job.

i've seen an example in python cookbook, but do not have the copy with 
me right now. If you have that book, look at the example to send HTML
mails. keywords are htmllib and formatter/AbstractFormatter.
IIRC they mention it's not that perfect as doing the same with lynx.
Don't know if the onlineversion at activestate does have this example.

> 
> But I need a 100% pythonic stuff to have my app (Zope product) running on
> non Unix boxes.

That would be 100% pythonic even w/o external stuff.

> 
> Any hint ?
> 
> Thanks in advance.
> 
> --Gilles
> 

HTH Karl





More information about the Python-list mailing list