(html)
return u'\n'.join(unicode(block) for block in blocklist[1:] if unicode(block).strip())
Extract plain text from HTML.
Extract plain text from HTML.
Extract plain text from HTML .
def _html_to_text(html):
    """Extract plain text from HTML."""
    doc = etree.parse(StringIO(html), etree.HTMLParser(encoding='utf-8'))
    blocklist = _parse_element(doc.getroot())
    return u'\n'.join(unicode(block) for block in blocklist[1:] if unicode(block).strip())
def _html_to_text ( html ) : doc = etree . parse ( StringIO ( html ) , etree . HTMLParser ( encoding = 'utf-8' ) ) blocklist = _parse_element ( doc . getroot ( ) ) return u'\n' . join ( unicode ( block ) for block in blocklist [ 1 : ] if unicode ( block ) . strip ( ) )