code: def textFromHTML(html):
      
      cleaner = lxml.html.clean.Cleaner(scripts=True)
      cleaned = cleaner.clean_html(html)
      return lxml.html.fromstring(cleaned).text_content()
docs: Cleans and parses text from the given HTML.