Skip to content

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

contains()

Return true if text contains at least one Mitre TTP.

extract()

Return the whole text as object.