From 42fb85af48321dfa52a05a0069292b6fb5430bce Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Fri, 29 Nov 2024 11:01:26 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20d'informations=20compl=C3=A9mentaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cf #216 --- .../import_tasks/custom_extractors/lacomedie.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/agenda_culturel/import_tasks/custom_extractors/lacomedie.py b/src/agenda_culturel/import_tasks/custom_extractors/lacomedie.py index ecad9c8..5bc6312 100644 --- a/src/agenda_culturel/import_tasks/custom_extractors/lacomedie.py +++ b/src/agenda_culturel/import_tasks/custom_extractors/lacomedie.py @@ -106,6 +106,15 @@ class CExtractor(TwoStepsExtractor): description = soup.select("#descspec") if description and len(description) > 0: description = description[0].get_text().replace("Lire plus...", "") + # on ajoute éventuellement les informations complémentaires + + d_suite = "" + for d in ["typedesc", "dureedesc", "lieuspec"]: + comp_desc = soup.select("#" + d) + if comp_desc and len(comp_desc) > 0: + d_suite += "\n\n" + comp_desc[0].get_text() + if d_suite != "": + description += "\n\n> Informations complémentaires:" + d_suite else: description = None