I am working on a python script where I use data from a HTML file. I use the HTMLParser module, with my own handle_endtag and so on, as described here
When handling exceptions, I am looking at handling the HTMLParser.HTMLParseError exception. Yet I cannot make a test case where the parser throws an exception! Two questions:
Is the parser so good at parsing anything that handling the exception is useless?
Can someone cook up a test input that makes the parser throw the exception ? (I want to see what it looks like!)
Poor, tortured, parser.