HtmlParser
HtmlParser(text, parsertype='html')
¶
Bases: ParserInterface
Implementation of ParserInterface for HTML strings.
Code exemple :: a = HtmlParser("dsfsd sdfsdf sdfsdhj j") b = HtmlParser("Hello, world") print(a.extract(), a.contains()) print(b.extract(), b.contains())
Source : https://stackoverflow.com/questions/24856035/how-to-detect-with-python-if-the-string-contains-html-code