diff --git a/src/agenda_culturel/import_tasks/custom_extractors/lacomedie.py b/src/agenda_culturel/import_tasks/custom_extractors/lacomedie.py index 7c97151..7f999a3 100644 --- a/src/agenda_culturel/import_tasks/custom_extractors/lacomedie.py +++ b/src/agenda_culturel/import_tasks/custom_extractors/lacomedie.py @@ -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