From 6977bb588fddba33ccc15e9f383157b0c6c9b9ee Mon Sep 17 00:00:00 2001 From: CHUN YU YAO Date: Fri, 24 Mar 2023 00:09:32 +0800 Subject: [PATCH] 2023-03-21, fix bugs for ibon. --- chrome_tixcraft.py | 24 ++++++++---------------- config_launcher.py | 2 +- settings.py | 2 +- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/chrome_tixcraft.py b/chrome_tixcraft.py index e3b9452..da3848f 100644 --- a/chrome_tixcraft.py +++ b/chrome_tixcraft.py @@ -53,7 +53,7 @@ import argparse import ssl ssl._create_default_https_context = ssl._create_unverified_context -CONST_APP_VERSION = u"MaxBot (2023.03.20)" +CONST_APP_VERSION = u"MaxBot (2023.03.21)" CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt" @@ -6371,7 +6371,8 @@ def ibon_verification_question(driver, answer_index, config_dict): form_input.clear() form_input.send_keys(inferred_answer_string) is_button_clicked = force_press_button(driver, By.CSS_SELECTOR,'div.editor-box > div > div.form-group > a.btn') - is_password_sent = True + if is_button_clicked: + is_password_sent = True # guess answer mode. answer_index += 1 @@ -6438,27 +6439,19 @@ def ibon_ticket_agree(driver): try: form_checkbox = driver.find_element(By.ID, 'agreen') except Exception as exc: - print("find #agreen fail") + #print("find #agreen fail") + pass is_finish_checkbox_click = False if form_checkbox is not None: try: - # TODO: check the status: checked. if form_checkbox.is_enabled(): if not form_checkbox.is_selected(): form_checkbox.click() - is_finish_checkbox_click = True + is_finish_checkbox_click = True except Exception as exc: - print("click #agreen fail") - #pass - try: - print("use plan_b to check #agreen.") - driver.execute_script("$(\"input[type='checkbox']\").prop('checked', true);") - is_finish_checkbox_click = True - except Exception as exc: - print("javascript check #agreen fail") - print(exc) - pass + print("click #agreen fail, try plan_b click label.") + is_finish_checkbox_click = force_press_button(driver, By.CSS_SELECTOR,'label[for="agreen"]') return is_finish_checkbox_click @@ -6521,7 +6514,6 @@ def ibon_main(driver, url, config_dict, ibon_dict): else: ibon_dict["answer_index"] = -1 - if not is_match_target_feature: # https://orders.ibon.com.tw/application/UTK02/UTK0201_000.aspx?PERFORMANCE_ID=0000 if '/application/UTK02/' in url and '.aspx?PERFORMANCE_ID=' in url: diff --git a/config_launcher.py b/config_launcher.py index 4df3ccc..f97a74f 100644 --- a/config_launcher.py +++ b/config_launcher.py @@ -22,7 +22,7 @@ import base64 import threading import subprocess -CONST_APP_VERSION = u"MaxBot (2023.03.20)" +CONST_APP_VERSION = u"MaxBot (2023.03.21)" CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json" CONST_MAXBOT_CONFIG_FILE = "settings.json" diff --git a/settings.py b/settings.py index 5889652..6ce4d2f 100644 --- a/settings.py +++ b/settings.py @@ -24,7 +24,7 @@ import time import threading import subprocess -CONST_APP_VERSION = u"MaxBot (2023.03.20)" +CONST_APP_VERSION = u"MaxBot (2023.03.21)" CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt"