2023-12-09

master
CHUN YU YAO 2023-12-15 00:31:44 +08:00
parent a9bcce7f96
commit bf11afef6d
4 changed files with 55 additions and 44 deletions

View File

@ -53,7 +53,7 @@ import webbrowser
import chromedriver_autoinstaller import chromedriver_autoinstaller
CONST_APP_VERSION = "MaxBot (2023.12.08)" CONST_APP_VERSION = "MaxBot (2023.12.09)"
CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_CONFIG_FILE = "settings.json"
CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt" CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt"
@ -10853,6 +10853,7 @@ def ticketplus_date_auto_select(driver, config_dict):
matched_blocks = None matched_blocks = None
formated_area_list = None formated_area_list = None
is_vue_ready = True
if not area_list is None: if not area_list is None:
area_list_count = len(area_list) area_list_count = len(area_list)
@ -10878,6 +10879,12 @@ def ticketplus_date_auto_select(driver, config_dict):
if reset_row_text_if_match_keyword_exclude(config_dict, row_text): if reset_row_text_if_match_keyword_exclude(config_dict, row_text):
row_text = "" row_text = ""
if len(row_text) > 0:
if '<div class="v-progress-circular__info"></div>' in row_html:
# vue not applied.
is_vue_ready = False
break
if len(row_text) > 0: if len(row_text) > 0:
row_is_enabled=False row_is_enabled=False
for text_item in find_ticket_text_list: for text_item in find_ticket_text_list:
@ -10921,44 +10928,45 @@ def ticketplus_date_auto_select(driver, config_dict):
print("date date-time-position is None") print("date date-time-position is None")
pass pass
target_area = get_target_item_from_matched_list(matched_blocks, auto_select_mode)
is_date_clicked = False is_date_clicked = False
if not target_area is None: if is_vue_ready:
target_button = None target_area = get_target_item_from_matched_list(matched_blocks, auto_select_mode)
try: if not target_area is None:
target_button = target_area.find_element(By.CSS_SELECTOR, 'button') target_button = None
if not target_button is None: try:
if target_button.is_enabled(): target_button = target_area.find_element(By.CSS_SELECTOR, 'button')
if not target_button is None:
if target_button.is_enabled():
if show_debug_message:
print("start to press button...")
target_button.click()
is_date_clicked = True
else:
if show_debug_message: if show_debug_message:
print("start to press button...") print("target_button in target row is None.")
target_button.click() except Exception as exc:
is_date_clicked = True
else:
if show_debug_message: if show_debug_message:
print("target_button in target row is None.") print("find or press button fail:", exc)
except Exception as exc:
if show_debug_message:
print("find or press button fail:", exc)
if not target_button is None: if not target_button is None:
#print("try to click button fail, force click by js.") #print("try to click button fail, force click by js.")
try:
#driver.execute_script("arguments[0].click();", target_button)
pass
except Exception as exc:
pass
# [PS]: current reload condition only when
if auto_reload_coming_soon_page_enable:
if not is_date_clicked:
if not formated_area_list is None:
if len(formated_area_list) == 0:
try: try:
driver.refresh() #driver.execute_script("arguments[0].click();", target_button)
time.sleep(0.3) pass
except Exception as exc: except Exception as exc:
pass pass
# [PS]: current reload condition only when
if auto_reload_coming_soon_page_enable:
if not is_date_clicked:
if not formated_area_list is None:
if len(formated_area_list) == 0:
try:
driver.refresh()
time.sleep(0.3)
except Exception as exc:
pass
return is_date_clicked return is_date_clicked
def ticketplus_assign_ticket_number(target_area, config_dict): def ticketplus_assign_ticket_number(target_area, config_dict):
@ -11065,16 +11073,19 @@ def ticketplus_order_expansion_auto_select(driver, config_dict, area_keyword_ite
# not found closed-folder button, try scan opened-text-title. # not found closed-folder button, try scan opened-text-title.
if show_debug_message: if show_debug_message:
print("not found closed-folder button, try scan opened-text-title") print("not found closed-folder button, try scan opened-text-title")
my_css_selector = 'div.seats-area > div.v-expansion-panel[aria-expanded="false"]'
area_list = driver.find_elements(By.CSS_SELECTOR, my_css_selector) my_css_selector = 'div.price-group > div'
is_click_on_folder = True price_group_list = driver.find_elements(By.CSS_SELECTOR, my_css_selector)
if len(price_group_list) > 0:
if len(area_list)==1: # price group style.
my_css_selector = 'div.seats-area > div.v-expansion-panel[aria-expanded="true"]' my_css_selector = 'div.seats-area > div.v-expansion-panel'
area_list_parent = driver.find_elements(By.CSS_SELECTOR, my_css_selector) area_list = driver.find_elements(By.CSS_SELECTOR, my_css_selector)
if len(area_list_parent) > 0: else:
# change keyword to match all. # no price group style.
area_keyword_item = "" my_css_selector = 'div.seats-area > div.v-expansion-panel[aria-expanded="false"]'
area_list = driver.find_elements(By.CSS_SELECTOR, my_css_selector)
# triger re-query again.
is_click_on_folder = True
except Exception as exc: except Exception as exc:
if current_layout_style == 1: if current_layout_style == 1:

View File

@ -22,7 +22,7 @@ import sys
import threading import threading
import webbrowser import webbrowser
CONST_APP_VERSION = "MaxBot (2023.12.08)" CONST_APP_VERSION = "MaxBot (2023.12.09)"
CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json" CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json"
CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_CONFIG_FILE = "settings.json"

View File

@ -34,7 +34,7 @@ import ssl
ssl._create_default_https_context = ssl._create_unverified_context ssl._create_default_https_context = ssl._create_unverified_context
CONST_APP_VERSION = "MaxBot (2023.12.08)" CONST_APP_VERSION = "MaxBot (2023.12.09)"
CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_CONFIG_FILE = "settings.json"
CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt" CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt"

View File

@ -27,7 +27,7 @@ import pyperclip
import tornado import tornado
from tornado.web import Application from tornado.web import Application
CONST_APP_VERSION = "MaxBot (2023.12.08)" CONST_APP_VERSION = "MaxBot (2023.12.09)"
CONST_MAXBOT_QUESTION_FILE = "MAXBOT_QUESTION.txt" CONST_MAXBOT_QUESTION_FILE = "MAXBOT_QUESTION.txt"