home · contact · privacy
Fix buggy HTMLParser.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 19 Jan 2016 00:36:15 +0000 (01:36 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 19 Jan 2016 00:36:15 +0000 (01:36 +0100)
plomlombot.py

index f34d97a..9e9d0a4 100755 (executable)
@@ -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 = ""