clear resources

main
saif 2025-08-13 13:07:36 +05:00
parent 0469db1ff4
commit e9ac547c8b
1 changed files with 16 additions and 14 deletions

View File

@ -156,17 +156,19 @@ def get_amazon_ranks(url, marketplace, ratingPrefix, keyword, page, count):
return count return count
driver = get_driver() try :
driver = get_driver()
for keyword in keywords: for keyword in keywords:
for marketplace, details in marketplaces.items(): for marketplace, details in marketplaces.items():
if marketplace == 'AMAZON_USA': if marketplace == 'AMAZON_USA':
url = details['url'] url = details['url']
ratingPrefix = details['ratingPrefix'] ratingPrefix = details['ratingPrefix']
count =1 count =1
for i in range(1, MAX_PAGE): for i in range(1, MAX_PAGE):
count = get_amazon_ranks(url, marketplace, ratingPrefix, keyword, i, count) count = get_amazon_ranks(url, marketplace, ratingPrefix, keyword, i, count)
if count == -1: if count == -1:
break break
sleep(3) sleep(3)
driver.quit() finally:
print("[INFO] Closing WebDriver...")
driver.quit()