in reply to Parsing badly formed HTML
Well, it's hard to say whether you could have done better. Depending how bad the HTML is formatted (assuming, you mean "incorrect" where you say "bad"), no CPAN module can help you. And even if you find a CPAN module that accepts the first 100 incorrectly formatted HTML documents, it may choke on the next one you give it.