html_string = """
<!DOCTYPE html>
<html><head><title>title</title></head><body><p>test</p></body></html>
"""
doc = parseString(html_string)
paragraph = doc.getElementsByTagName('p')[0]
content = paragraph.firstChild.data
print(content)
Python: Is there a built in package to parse html into dom