From 1585d92508a121ef33f0329228d66f3ac94e14d7 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sun, 9 Jun 2024 23:27:19 +0200 Subject: [PATCH] =?UTF-8?q?Substitution=20des=20espaces=20ins=C3=A9cables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nupes/scripts/import_resultats_web_2024.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nupes/scripts/import_resultats_web_2024.py b/nupes/scripts/import_resultats_web_2024.py index 42da5c5..d9a5646 100644 --- a/nupes/scripts/import_resultats_web_2024.py +++ b/nupes/scripts/import_resultats_web_2024.py @@ -267,7 +267,7 @@ def analyser_resultats(file) -> dict: resultats_par_liste.append(liste) liste['nom'] = cells[0].string - liste['voix'] = int(cells[2].string.replace("\n", "").replace(" ", "")) + liste['voix'] = int(cells[2].string.replace("\n", "").replace(" ", "").replace("\u202f", "").strip()) elif table.find('td', text=re.compile("Inscrits")): tbody = table.tbody for line in tbody.find_all('tr'): @@ -276,7 +276,7 @@ def analyser_resultats(file) -> dict: continue nom = cells[0].string - number = int(cells[1].string.replace(" ", "")) + number = int(cells[1].string.replace("\n", "").replace(" ", "").replace("\u202f", "").strip()) match nom: case "Inscrits": parsed_data["inscrits"] = number