minor fixes
parent
e9ac547c8b
commit
44cf2b4395
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue