fix chrome options not able to reuse bug.

master
Max 2023-08-14 15:57:53 +08:00 committed by GitHub
parent 30ed5e271b
commit 70ca0e251c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -54,7 +54,7 @@ import webbrowser
import argparse import argparse
import chromedriver_autoinstaller import chromedriver_autoinstaller
CONST_APP_VERSION = "MaxBot (2023.08.10)" CONST_APP_VERSION = "MaxBot (2023.08.11)"
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"
@ -452,10 +452,12 @@ def load_chromdriver_normal(config_dict, driver_type):
chromedriver_autoinstaller.install(path=webdriver_path, make_version_dir=False) chromedriver_autoinstaller.install(path=webdriver_path, make_version_dir=False)
chrome_service = Service(chromedriver_path) chrome_service = Service(chromedriver_path)
try: try:
chrome_options = get_chrome_options(webdriver_path, config_dict["advanced"]["adblock_plus_enable"], browser=config_dict["browser"], headless=config_dict["advanced"]["headless"])
driver = webdriver.Chrome(service=chrome_service, options=chrome_options) driver = webdriver.Chrome(service=chrome_service, options=chrome_options)
except Exception as exc2: except Exception as exc2:
print("Selenium 4.11.0 Release with Chrome For Testing Browser.") print("Selenium 4.11.0 Release with Chrome For Testing Browser.")
try: try:
chrome_options = get_chrome_options(webdriver_path, config_dict["advanced"]["adblock_plus_enable"], browser=config_dict["browser"], headless=config_dict["advanced"]["headless"])
driver = webdriver.Chrome(service=Service(), options=chrome_options) driver = webdriver.Chrome(service=Service(), options=chrome_options)
except Exception as exc3: except Exception as exc3:
print(exc3) print(exc3)
@ -7613,6 +7615,7 @@ def cityline_main(driver, url, config_dict):
pass pass
if 'cityline.com/queue?' in url: if 'cityline.com/queue?' in url:
# show HTTP ERROR 400
pass pass