fix 輸入驗證碼的框時可能會一直跳出去點選其他地方,導致無法正常輸入驗證碼

master
Max 2023-04-14 12:15:45 +08:00 committed by GitHub
parent 62b94df8b9
commit 4ddbce9ec5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 6 deletions

View File

@ -9250,12 +9250,26 @@ def ticketplus_order_expansion_panel(driver, config_dict):
return is_price_assign_by_bot return is_price_assign_by_bot
def ticketplus_order(driver, config_dict, ocr, Captcha_Browser): def ticketplus_order(driver, config_dict, ocr, Captcha_Browser):
is_price_assign_by_bot = ticketplus_order_expansion_panel(driver, config_dict) next_step_button = None
if is_price_assign_by_bot: is_button_disabled = False
if config_dict["ocr_captcha"]["enable"]: try:
# OCR alway guess wrong answer, disable for now. my_css_selector = "div.order-footer > div.container > div.row > div > div.row > div > button.nextBtn"
# ticketplus_order_ocr(driver, config_dict, ocr, Captcha_Browser) next_step_button = driver.find_element(By.CSS_SELECTOR, my_css_selector)
pass if not next_step_button is None:
if not next_step_button.is_enabled():
is_button_disabled = True
except Exception as exc:
print("find next_step_button fail")
print(exc)
#print("is_button_disabled:", is_button_disabled)
if is_button_disabled:
is_price_assign_by_bot = ticketplus_order_expansion_panel(driver, config_dict)
if is_price_assign_by_bot:
if config_dict["ocr_captcha"]["enable"]:
# OCR alway guess wrong answer, disable for now.
# ticketplus_order_ocr(driver, config_dict, ocr, Captcha_Browser)
pass
def ticketplus_order_ocr(driver, config_dict, ocr, Captcha_Browser): def ticketplus_order_ocr(driver, config_dict, ocr, Captcha_Browser):
away_from_keyboard_enable = config_dict["ocr_captcha"]["force_submit"] away_from_keyboard_enable = config_dict["ocr_captcha"]["force_submit"]