On change d'année
This commit is contained in:
parent
963d82066e
commit
39aa4a8d3c
@ -29,8 +29,8 @@ from src.agenda_culturel.import_tasks.custom_extractors import *
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
u2e = URL2Events(SimpleDownloader(), lacomedie.CExtractor())
|
u2e = URL2Events(SimpleDownloader(), lacomedie.CExtractor())
|
||||||
url = "https://lacomediedeclermont.com/saison23-24/wp-admin/admin-ajax.php?action=load_dates_existantes"
|
url = "https://lacomediedeclermont.com/saison24-25/wp-admin/admin-ajax.php?action=load_dates_existantes"
|
||||||
url_human = "https://lacomediedeclermont.com/saison23-24/"
|
url_human = "https://lacomediedeclermont.com/saison24-25/"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
events = u2e.process(url, url_human, cache = "cache-lacomedie.html", default_values = {"location": "La Comédie de Clermont"}, published = True)
|
events = u2e.process(url, url_human, cache = "cache-lacomedie.html", default_values = {"location": "La Comédie de Clermont"}, published = True)
|
||||||
|
@ -4,10 +4,10 @@ from bs4 import BeautifulSoup
|
|||||||
|
|
||||||
# A class dedicated to get events from La Coopérative de Mai:
|
# A class dedicated to get events from La Coopérative de Mai:
|
||||||
# URL: https://lacomediedeclermont.com/saison23-24/wp-admin/admin-ajax.php?action=load_dates_existantes
|
# URL: https://lacomediedeclermont.com/saison23-24/wp-admin/admin-ajax.php?action=load_dates_existantes
|
||||||
# URL pour les humains: https://lacomediedeclermont.com/saison23-24/
|
# URL pour les humains: https://lacomediedeclermont.com/saison24-25/
|
||||||
class CExtractor(TwoStepsExtractor):
|
class CExtractor(TwoStepsExtractor):
|
||||||
nom_lieu = "La Comédie de Clermont"
|
nom_lieu = "La Comédie de Clermont"
|
||||||
url_referer = "https://lacomediedeclermont.com/saison23-24/"
|
url_referer = "https://lacomediedeclermont.com/saison24-25/"
|
||||||
|
|
||||||
def category_comedie2agenda(self, category):
|
def category_comedie2agenda(self, category):
|
||||||
mapping = {
|
mapping = {
|
||||||
@ -31,7 +31,7 @@ class CExtractor(TwoStepsExtractor):
|
|||||||
events = self.downloader.get_content(
|
events = self.downloader.get_content(
|
||||||
url,
|
url,
|
||||||
post={"action": "load_evenements_jour", "jour": d},
|
post={"action": "load_evenements_jour", "jour": d},
|
||||||
referer="https://lacomediedeclermont.com/saison23-24/"
|
referer="https://lacomediedeclermont.com/saison24-25/"
|
||||||
)
|
)
|
||||||
if events:
|
if events:
|
||||||
events = json5.loads(events)
|
events = json5.loads(events)
|
||||||
|
Loading…
Reference in New Issue
Block a user