Substitution des espaces insécables

This commit is contained in:
Emmy D'Anello 2024-06-09 23:27:19 +02:00
parent 79763a04c9
commit 1585d92508
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -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