diff --git a/src/cogs/election.py b/src/cogs/election.py index fd84652..9b36b39 100644 --- a/src/cogs/election.py +++ b/src/cogs/election.py @@ -78,7 +78,7 @@ class ElectionCog(commands.Cog): self.log.warning("%r did not have a 'span' element.", child_ul) continue - text = span.get_text() + text = span.get_text().replace(",", "") groups = SPAN_REGEX.match(text) if groups: groups = groups.groupdict() @@ -90,8 +90,8 @@ class ElectionCog(commands.Cog): continue results[str(groups["party"]).strip()] = [ - int(groups["councillors"].strip().strip(",")), - int(groups["net"].strip().strip(",")) * MULTI[groups["net_change"]], + int(groups["councillors"].strip()), + int(groups["net"].strip()) * MULTI[groups["net_change"]], int(find_colour(child_ul.next["class"][0])[1:], base=16) ] return results