From 24d88d3ed8d1e4a67b914012bb9b0c2a3d63447d Mon Sep 17 00:00:00 2001 From: ehsang Date: Sun, 1 Dec 2024 23:05:16 +0330 Subject: [PATCH] tasks bug fix --- say/crawler/__init__.py | 5 ++++- say/models/need_model.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/say/crawler/__init__.py b/say/crawler/__init__.py index e5d82fec..ee5558a7 100644 --- a/say/crawler/__init__.py +++ b/say/crawler/__init__.py @@ -126,7 +126,7 @@ def get_data(self, force=False): r = requests.get(url) else: r = request_with_cache(url) - + if r.status_code == 200: result = r.json() @@ -140,6 +140,9 @@ def get_data(self, force=False): r = request_with_cache(url) result = r.json() + print("url and result:") + print(url) + print(result) if r.status_code != 200: return diff --git a/say/models/need_model.py b/say/models/need_model.py index fd0117c5..ce604eac 100644 --- a/say/models/need_model.py +++ b/say/models/need_model.py @@ -449,6 +449,7 @@ def update(self, force=False): if 'digikala' in self.link: print("updating via crawler.....") data = DigikalaCrawler(self.link).get_data(force=force) + print("Done updating.") else: data = Crawler(self.link).get_data(force=force)