From: Christian Heller Date: Tue, 19 Jan 2016 00:36:15 +0000 (+0100) Subject: Fix buggy HTMLParser. X-Git-Url: https://plomlompom.com/repos/test?a=commitdiff_plain;h=9260bc740d86b0b83d90c31eea2f898dfb2cf594;p=plomlombot-irc.git Fix buggy HTMLParser. --- diff --git a/plomlombot.py b/plomlombot.py index f34d97a..9e9d0a4 100755 --- a/plomlombot.py +++ b/plomlombot.py @@ -22,11 +22,12 @@ NICKNAME = USERNAME class HTMLParser(html.parser.HTMLParser): def __init__(self, html, tag): super().__init__() + self._tag_to_check = tag self._tag = "" self.data = "" self.feed(html) def handle_starttag(self, tag, attrs): - if self.data == "": + if self.data == "" and tag == self._tag_to_check: self._tag = tag def handle_endtag(self, tag): self._tag = ""