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
driver = get_driver()
for keyword in keywords:
for marketplace, details in marketplaces.items():
if marketplace == 'AMAZON_USA':
url = details['url']
ratingPrefix = details['ratingPrefix']
count =1
for i in range(1, MAX_PAGE):
count = get_amazon_ranks(url, marketplace, ratingPrefix, keyword, i, count)
if count == -1:
break
sleep(3)
driver.quit()
try :
driver = get_driver()
for keyword in keywords:
for marketplace, details in marketplaces.items():
if marketplace == 'AMAZON_USA':
url = details['url']
ratingPrefix = details['ratingPrefix']
count =1
for i in range(1, MAX_PAGE):
count = get_amazon_ranks(url, marketplace, ratingPrefix, keyword, i, count)
if count == -1:
break
sleep(3)
finally:
print("[INFO] Closing WebDriver...")
driver.quit()