[Tutor] how to remove html ags

Kent Johnson kent37 at tds.net
Mon Aug 14 14:00:53 CEST 2006


anil maran wrote:
> <p><div class="quote">Human nature is not a machin... 
> <http://feeds.feedburner.com/Caterinanet?m=1228>
>
> for example in the above stirng
>
> i want to remove <p>
> and <div class="quote">
Try one of these:
http://www.oluyede.org/blog/2006/02/13/html-stripper/
http://www.aminus.org/rbre/python/cleanhtml.py
>
> i tried
>
> str = str.replace('(.*)','')
>
> it doesnt work
because it looks for a literal "(.*)" in the string and replaces it with 
an empty string. Since "(.*)" doesn't appear, nothing is replaced.

Kent
> thanks
>
> ------------------------------------------------------------------------
> Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great 
> rates starting at 1¢/min. 
> <http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com> 
>
>
>  <http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>  <http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com>




More information about the Tutor mailing list