From 5ba6894313c583739bc4facaee376b63157815b6 Mon Sep 17 00:00:00 2001 From: "shariar@raenabeauty.com" Date: Mon, 18 Mar 2024 12:29:04 +0400 Subject: [PATCH] added Hasaki crawler --- hasaki_crawler_engine/hasaki_product_info.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hasaki_crawler_engine/hasaki_product_info.py b/hasaki_crawler_engine/hasaki_product_info.py index 0fd9605..d2d9693 100644 --- a/hasaki_crawler_engine/hasaki_product_info.py +++ b/hasaki_crawler_engine/hasaki_product_info.py @@ -400,7 +400,7 @@ class HasakiProductInfo: except: pass - reviews = reviews1 + reviews2 + reviews = self.join_lists(reviews1, reviews2) @@ -446,7 +446,17 @@ class HasakiProductInfo: except Exception as e: logging.info(e) - + def join_lists(self, list1, list2): + # Check if both lists are None + if list1 is None and list2 is None: + return None + # Check if one of the lists is None + elif list1 is None: + return list2 + elif list2 is None: + return list1 + else: + return list1 + list2 def seo_info(self, raw_data):