From aaf84022e66031be39421aaba61dbf564c215ea9 Mon Sep 17 00:00:00 2001 From: "shariar@raenabeauty.com" Date: Fri, 2 Feb 2024 10:08:37 +0400 Subject: [PATCH] FB Marketplace crawler --- fb_marketplace/fb_marketplace_product_info.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fb_marketplace/fb_marketplace_product_info.py b/fb_marketplace/fb_marketplace_product_info.py index 26f5338..320336f 100644 --- a/fb_marketplace/fb_marketplace_product_info.py +++ b/fb_marketplace/fb_marketplace_product_info.py @@ -25,7 +25,7 @@ class FbMarketplaceProductInfo: op.add_argument('--user-data-dir=/home/ec2-user/fb-crawler-binary/chrome/fb_marketplace') self.version_main = 120 self.driver = Chrome(options=op, version_main=self.version_main) - #time.sleep(3000) + time.sleep(3000) self.cur.execute("select id from " + self.config.get('crawler_schema') + "." + self.config.get( 'source_tab') + " where source_name='fb_marketplace'") @@ -126,6 +126,10 @@ class FbMarketplaceProductInfo: pass pass + if seller_name=="": + time.sleep(5) + return + try: seller_link = self.driver.find_element(By.XPATH, "/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div/div/div/div[1]/div[2]/div/div[2]/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div/div/div/div[2]/div/div/div/div/span/span/div/div/a").get_attribute("href") except: