On protège des cas cassés

This commit is contained in:
Jean-Marie Favreau 2024-07-06 19:33:15 +02:00
parent 9a97f12337
commit 963d82066e

View File

@ -78,12 +78,15 @@ class CExtractor(TwoStepsExtractor):
soup = BeautifulSoup(event_content, "html.parser")
image = soup.select("#imgspec img")
if image:
if image and len(image) > 0:
image = image[0]["src"]
else:
image = None
description = soup.select("#descspec")[0].get_text().replace("Lire plus...", "")
description = soup.select("#descspec")
if description and len(description) > 0:
description = description[0].get_text().replace("Lire plus...", "")
url_human = event_url