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
1 changed files with 2 additions and 2 deletions

View File

@ -267,7 +267,7 @@ def analyser_resultats(file) -> dict:
resultats_par_liste.append(liste) resultats_par_liste.append(liste)
liste['nom'] = cells[0].string 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")): elif table.find('td', text=re.compile("Inscrits")):
tbody = table.tbody tbody = table.tbody
for line in tbody.find_all('tr'): for line in tbody.find_all('tr'):
@ -276,7 +276,7 @@ def analyser_resultats(file) -> dict:
continue continue
nom = cells[0].string nom = cells[0].string
number = int(cells[1].string.replace(" ", "")) number = int(cells[1].string.replace("\n", "").replace(" ", "").replace("\u202f", "").strip())
match nom: match nom:
case "Inscrits": case "Inscrits":
parsed_data["inscrits"] = number parsed_data["inscrits"] = number