diff --git a/src/cogs/election.py b/src/cogs/election.py index 44b0c3f..67df7f8 100644 --- a/src/cogs/election.py +++ b/src/cogs/election.py @@ -128,32 +128,12 @@ class ElectionCog(commands.Cog): self.log.error("failed to parse %r", span) continue results[party] = [seats, change, 0, 0] - # if not span: - # self.log.warning("%r did not have a 'span' element.", child_ul) - # continue - - # text = span.get_text().replace(",", "") - # groups = SPAN_REGEX.match(text) - # if groups: - # groups = groups.groupdict() - # else: - # self.log.warning( - # "Found span element (%r), however resolved text (%r) did not match regex.", - # span, text - # ) - # continue - - # results[str(groups["party"]).strip()] = [ - # int(groups["councillors"].strip()), - # int(groups["net"].strip()) * MULTI[groups["net_change"]], - # int(find_colour(child_ul.next["class"][0])[1:], base=16) - # ] for child_li in good_soups[1].children: span = list(child_li.children)[-1] try: party, extra = span.get_text().strip().split(":", 1) - seats, _ = extra.split(" ", 1) - seats = int(seats) + seats, _ = extra.strip().split(" ", 1) + seats = int(seats.strip()) except ValueError: self.log.error("failed to parse %r", span) continue