throw an exception with string "unexpected call to parse_endtag" as the message. search anywhere in the rawdata string starting from the (i+1)-th element for the _html_parser.endendeag, replace the result for match.
match = _html_parser . endendtag . search ( rawdata , i + 1 )