From e050ce5edae79fa4093b49a1ab54c5924cb060b0 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sat, 7 Dec 2024 10:11:36 +0100 Subject: [PATCH] =?UTF-8?q?On=20d=C3=A9sactive=20la=20sortie=20d'erreurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../import_tasks/custom_extractors/fbevents.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/agenda_culturel/import_tasks/custom_extractors/fbevents.py b/src/agenda_culturel/import_tasks/custom_extractors/fbevents.py index bf02a96..d6be501 100644 --- a/src/agenda_culturel/import_tasks/custom_extractors/fbevents.py +++ b/src/agenda_culturel/import_tasks/custom_extractors/fbevents.py @@ -19,6 +19,8 @@ class CExtractor(TwoStepsExtractor): def build_event_url_list(self, content): soup = BeautifulSoup(content, "html.parser") + debug = False + found = False links = soup.find_all("a") for link in links: @@ -26,7 +28,7 @@ class CExtractor(TwoStepsExtractor): self.add_event_url(link.get('href').split('?')[0]) found = True - if not found: + if not found and debug: directory = "errors/" if not os.path.exists(directory): os.makedirs(directory)