SV: [Zope] Strip all HTML
Carsten Gehling
carsten@gehling.dk
Wed Aug 6 19:37:46 EDT 2003
> -----Oprindelig meddelelse-----
> Fra: zope-admin@zope.org [mailto:zope-admin@zope.org]Pa vegne af Chris
> Withers
> Sendt: 6. august 2003 13:30
>
> ken@practical.org wrote:
>
> > However this converter, like the others I have tried
> (Strip-o-Gram, as well as an external method based on
> striphtml.py), seem unable to remove the content of
> <style></style> or <script></script> tags. So I get plenty of
> hits with a search for 'children' or 'window' or 'background'...
>
> I beg to differ:
>
> Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from stripogram import html2text
> >>> html = "seem unable to remove the content of
> <style>stuff</style> or <script
> >more stuff</script>"
> >>> html2text(html)
> 'seem unable to remove the content of stuff or more stuff'
> >>>
>
> How are you using stripogram?
Your own example shows that stripogram does NOT remove the content between
<style>...</style> and <script>...</script>.
What ken wants, is the result (of your example) to look like this:
'seem unable to remove the content of or'
- Carsten
More information about the Zope
mailing list