I want to parse a html snippet like below with the xml.etree.ElementTree module of python 3.
<html>
<table>
...
<td><img src="myimg.png" title="mytitle" alt="myalttext"></td>
...
</table>
</html>
But there is a "mismatched tag" parsing error due to the img-tag, which is closed with ">" not with "/>". No error occurs when I close the tag with "/>".
However, I'm loading that html from a website, so I just can't expect them to close the img-tag with "/>" (additionally this seems also to be a common way to just close it simply with ">", see W3Schools on images)
Do you have an idea how I can avoid this? I would also like to avoid to parse it manually before passing it to the xml.etree.ElementTree parser. I would also like to avoid using other parsers, unless they are already available in the default python library.