up planing familal properties

This commit is contained in:
Tykayn 2024-10-22 00:26:54 +02:00 committed by tykayn
parent e6a14ba84d
commit 61098395e1
2 changed files with 691 additions and 379 deletions

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,12 @@ antennes = []
for article in articles: for article in articles:
titre = article.find("button", class_="nsb action-title").text.strip() titre = article.find("button", class_="nsb action-title").text.strip()
adresse = article.find("p", class_="address").text.strip() adresse = article.find("p", class_="address").text.strip()
website = article.find("a", class_="icon arrow").get("href").strip()
violences = article.find("li", class_="icon violences")
sexualities = article.find("li", class_="icon sexualities")
detection = article.find("li", class_="icon detection")
contraception = article.find("li", class_="icon contraception")
abortion = article.find("li", class_="icon abortion")
# Gérer les articles qui n'ont pas de numéro de téléphone # Gérer les articles qui n'ont pas de numéro de téléphone
telephone = "" telephone = ""
@ -35,16 +41,18 @@ for article in articles:
antenne = { antenne = {
"type": "Feature", "type": "Feature",
"geometry":geometry, "geometry":geometry,
"properties": {
"nom": titre, "nom": titre,
"adresse": adresse, "adresse": adresse,
"telephone": telephone "contact:phone": telephone,
}, "contact:website": 'https://www.planning-familial.org/fr/'+website,
"family_planning:handles:violences": ('yes' if violences else 'no'),
"family_planning:handles:sexualities": ('yes' if sexualities else 'no'),
"family_planning:handles:detection": ('yes' if detection else 'no'),
"family_planning:handles:abortion": ('yes' if abortion else 'no'),
"family_planning:handles:contraception": ('yes' if contraception else 'no'),
} }
# print(antenne)
print(antenne)
antennes.append(antenne) antennes.append(antenne)