On protège des cas cassés
This commit is contained in:
parent
9a97f12337
commit
963d82066e
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user