Skip to content

Commit 698590c

Browse files
author
Meatplay
committed
Fix exception handling
1 parent 45939a7 commit 698590c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Diff for: flathunter/abstract_crawler.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def resolve_amazon(self, driver):
204204
"""Resolve Amazon Captcha"""
205205
try:
206206
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
207-
sleep(1)
207+
sleep(3)
208208
shadowelement = driver.execute_script("return document.querySelector('awswaf-captcha').shadowRoot")
209209
my_img = shadowelement.find_element(By.ID, "root")
210210
size = my_img.size
@@ -231,10 +231,13 @@ def resolve_amazon(self, driver):
231231
sleep(0.5)
232232
actions.reset_actions()
233233
sleep(1)
234-
confirm_button = my_img.find_element(By.ID, "amzn-btn-verify-internal")
235-
actions.move_to_element_with_offset(confirm_button, 40, 15).click()
236-
actions.perform()
237-
sleep(2)
234+
try:
235+
confirm_button = my_img.find_element(By.ID, "amzn-btn-verify-internal")
236+
actions.move_to_element_with_offset(confirm_button, 40, 15).click()
237+
actions.perform()
238+
sleep(4)
239+
except:
240+
pass
238241
try:
239242
driver.find_element(By.TAG_NAME, "awswaf-captcha")
240243
except:

0 commit comments

Comments
 (0)