def strip_all(self, html):
"""
Clean html content striping all html tags and removing all inline
script and style.
"""
try:
cleaner = Cleaner(style=True, kill_tags=self.kill_tags)
cleaned_html = cleaner.clean_html(html)
text = strip_tags(cleaned_html).replace('¶', '')
except ParserError:
return ""
return " ".join(text.split())
评论列表
文章目录