0

I'm now using NSXMLParser to parse html, but when meet "br" tag in html, it will throw an error for mismatch and stop to parse, because typically "/br" tag will not appear in html. So I want to ignore this mismatch error to continue parse, how to deal with it?

Yuwen Yan
  • 4,777
  • 10
  • 33
  • 63

1 Answers1

0

Not the best solution, but you might consider to do some regex correction before parsing, such as:

$input =~ s/<br>/<br \/>/ig;

Ωmega
  • 42,614
  • 34
  • 134
  • 203