On récupère les dates de la C3C, mais pas l'heure...
This commit is contained in:
parent
1c812a3d65
commit
ff681ed93a
@ -28,7 +28,7 @@ from src.agenda_culturel.import_tasks.custom_extractors import *
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
u2e = URL2Events(SimpleDownloader(), c3c.CExtractor())
|
u2e = URL2Events(ChromiumHeadlessDownloader(), c3c.CExtractor())
|
||||||
url = "https://billetterie-c3c.clermont-ferrand.fr/"
|
url = "https://billetterie-c3c.clermont-ferrand.fr/"
|
||||||
url_human = "https://billetterie-c3c.clermont-ferrand.fr/"
|
url_human = "https://billetterie-c3c.clermont-ferrand.fr/"
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ class CExtractor(TwoStepsExtractor):
|
|||||||
tags.append(tag)
|
tags.append(tag)
|
||||||
|
|
||||||
# TODO: parser les dates, récupérer les heures ()
|
# TODO: parser les dates, récupérer les heures ()
|
||||||
|
dates = [self.parse_french_date(o.get("value")) for o in soup.select("select.datedleb_resa option")]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,6 +64,13 @@ class Extractor(ABC):
|
|||||||
day = m.group(1)
|
day = m.group(1)
|
||||||
month = self.guess_month(m.group(2))
|
month = self.guess_month(m.group(2))
|
||||||
year = m.group(3)
|
year = m.group(3)
|
||||||
|
else:
|
||||||
|
# format Numero Mois Annee
|
||||||
|
m = re.search("([0-9]+)/([0-9]+)/([0-9]+)", text)
|
||||||
|
if m:
|
||||||
|
day = m.group(1)
|
||||||
|
month = int(m.group(2))
|
||||||
|
year = m.group(3)
|
||||||
else:
|
else:
|
||||||
# TODO: consolider les cas non satisfaits
|
# TODO: consolider les cas non satisfaits
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user