Newby: How do I strip HTML tags?
netvegetable
deathtospam43423 at altavista.com
Sat Jun 8 03:19:52 EDT 2002
Andy McKay <amckay at merlintechnologies.com> wrote in
news:mailman.1023469751.21489.python-list at python.org:
>> This is a quite straight forward function:
>
> This of course assumes that there are no "<" or ">" anywhere else in
> attributes etc...
>
> I would recommend using HTML Parser to get an accurate representation, or
> even stripogram which is pretty good (note it doesnt need Zope at all),
> although the html2text isnt perfect:
>
>>>> from stripogram import html2text html2text("<b>This is a
>>>> <i>test</i></b>") 'This is a test'
Thanx.
Is there an "HTMLParser Tutorial for Dummies" anywhere on the web?
--
netvegetable at excite.com
More information about the Python-list
mailing list