From 4ddbce9ec59f5f3034e5d3c97b953641e5e86295 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 14 Apr 2023 12:15:45 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=BC=B8=E5=85=A5=E9=A9=97=E8=AD=89?= =?UTF-8?q?=E7=A2=BC=E7=9A=84=E6=A1=86=E6=99=82=E5=8F=AF=E8=83=BD=E6=9C=83?= =?UTF-8?q?=E4=B8=80=E7=9B=B4=E8=B7=B3=E5=87=BA=E5=8E=BB=E9=BB=9E=E9=81=B8?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=9C=B0=E6=96=B9=EF=BC=8C=E5=B0=8E=E8=87=B4?= =?UTF-8?q?=E7=84=A1=E6=B3=95=E6=AD=A3=E5=B8=B8=E8=BC=B8=E5=85=A5=E9=A9=97?= =?UTF-8?q?=E8=AD=89=E7=A2=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chrome_tixcraft.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/chrome_tixcraft.py b/chrome_tixcraft.py index 7e23e50..4330ac7 100644 --- a/chrome_tixcraft.py +++ b/chrome_tixcraft.py @@ -9250,12 +9250,26 @@ def ticketplus_order_expansion_panel(driver, config_dict): return is_price_assign_by_bot def ticketplus_order(driver, config_dict, ocr, Captcha_Browser): - 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 + next_step_button = None + is_button_disabled = False + try: + my_css_selector = "div.order-footer > div.container > div.row > div > div.row > div > button.nextBtn" + next_step_button = driver.find_element(By.CSS_SELECTOR, my_css_selector) + 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): away_from_keyboard_enable = config_dict["ocr_captcha"]["force_submit"]