HTML -> text/plain "clever" formatting

Gilles Lenfant glenfant at NOSPAM.bigfoot.com
Mon Oct 6 08:54:02 EDT 2003


"Karl Scalet" <news at yebu.de> a écrit dans le message de news:
blrgg6$epn59$1 at ID-141451.news.uni-berlin.de...
> 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
>

Thanks Karl, I found what you're talking about

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52297

Need to rework that TtyFormatter in depth to mimic lynx :o)

Cheers

--Gilles





More information about the Python-list mailing list