From 9260bc740d86b0b83d90c31eea2f898dfb2cf594 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Tue, 19 Jan 2016 01:36:15 +0100 Subject: [PATCH] Fix buggy HTMLParser. --- plomlombot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 = "" -- 2.30.2