Compare commits

..

No commits in common. "e1ec580ce1cf4f2d0c0830aaea2b34fcf75b0be1" and "2c5ca3c3d3c4ea0370f609d779e1f776e04ea4cb" have entirely different histories.

2 changed files with 4 additions and 7 deletions

View File

@ -4,7 +4,6 @@
__author__ = 'kinoshitakenta'
__email__ = "ybs0306748@gmail.com"
import ctypes
import logging
import os
from pathlib import Path
@ -52,7 +51,6 @@ def display_usage():
clear_screen()
for cmd, msg in get_usage():
print(f"{cmd}: {msg}")
print()
def main(opt):
@ -64,12 +62,11 @@ def main(opt):
login_info = LoginInfo(config_path)
driver = get_driver()
keep_login_status(driver, login_info)
action_agent = Action(driver)
display_usage()
keep_login_status(driver, login_info)
try:
while True:
cmd = input("\nInput action code: ").strip()

View File

@ -8,7 +8,7 @@ if sys.version_info >= (3, 11):
else:
import tomli as tomllib
from selenium import webdriver
from selenium.common.exceptions import NoAlertPresentException, NoSuchWindowException, UnexpectedAlertPresentException
from selenium.common.exceptions import NoAlertPresentException, UnexpectedAlertPresentException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
@ -101,7 +101,7 @@ def keep_login_status(driver: webdriver.Chrome, login_info: LoginInfo) -> bool:
print(f"Login error message: {alert.text}")
alert.accept()
return False # Skip remaining logic, login failed
except (NoAlertPresentException, NoSuchWindowException):
except NoAlertPresentException:
pass # No alert, proceed
time.sleep(2)
@ -119,7 +119,7 @@ def keep_login_status(driver: webdriver.Chrome, login_info: LoginInfo) -> bool:
print(f"Unexpected alert: {alert.text}")
alert.accept()
continue
except (NoAlertPresentException, NoSuchWindowException):
except NoAlertPresentException:
continue
if "CHI MotorWeb - " in title: