def _clean_text(self, text): try: text = text.replace(" ", " ") text = text.strip() parser = HTMLParser(None) parser.save_bgn() parser.feed(text) return parser.save_end() except: return text
def _clean_text( self, text ): try: text = text.replace( " ", " " ) text = text.strip() parser = HTMLParser( None ) parser.save_bgn() parser.feed( text ) return parser.save_end() except: return text
def unescape(data): p = HTMLParser(None) p.save_bgn() p.feed(data) return p.save_end()
def unescape(s): from htmllib import HTMLParser p = HTMLParser(None) p.save_bgn() p.feed(s) return p.save_end()