From 44cf2b439588f64a69930dd0b646f0ce07726101 Mon Sep 17 00:00:00 2001 From: saif Date: Wed, 13 Aug 2025 14:33:57 +0500 Subject: [PATCH] minor fixes --- scrapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scrapper.py b/scrapper.py index 8264767..fb79af8 100644 --- a/scrapper.py +++ b/scrapper.py @@ -122,8 +122,8 @@ def get_amazon_ranks(url, marketplace, ratingPrefix, keyword, page, count): sleep(3) # Wait for JS to load items = driver.find_elements(By.XPATH, '//div[contains(@class,"s-result-item") and @data-asin]') for idx, item in enumerate(items, start=1): - asin = item.get_attribute("data-asin") try: + asin = item.get_attribute("data-asin") sponsored = check_sponsored(item) title = item.find_element(By.XPATH, './/h2//span').text rating = item.find_element(By.XPATH, './/span[@class="a-icon-alt"]') @@ -147,6 +147,7 @@ def get_amazon_ranks(url, marketplace, ratingPrefix, keyword, page, count): }) count += 1 except: + print( f"[ERROR] Error getting Amazon Ranks for: {marketplace} {keyword} {page} {idx}" ) continue file_path = f"{BASE_PATH}/{int(time.time() * 1000)}-{marketplace}-{keyword}.json"