Quote:print("RAW: This is an <a href=\"https://www.thesite.com/\">test</a> string.")This is just a string and not valid html or xml.
Then can regex be a better tool.
>>> import re >>> >>> s = "RAW: This is an <a href=\"https://www.thesite.com/\">test</a> string." >>> re.sub(r'<.*>', '', s) 'RAW: This is an string.'