[Tutor] finding mismatched or unpaired html tags

Dinesh B Vadhia dineshbvadhia at hotmail.com
Tue Apr 28 14:54:54 CEST 2009

I'm processing tens of thousands of html files and a few of them contain mismatched tags and ElementTree throws the error:

"Unexpected error opening J:/F2/663/blahblah.html: mismatched tag: line 124, column 8"

I now want to scan each file and simply identify each mismatched or unpaired tags (by line number) in each file.  I've read the ElementTree docs and cannot see anything obvious how to do this.  I know this is a common problem but feeling a bit clueless here - any ideas?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090428/a3d020b4/attachment.htm>

More information about the Tutor mailing list