Fix for Chrome / Chromium version > 114

This commit is contained in:
ngosang 2023-07-23 18:09:46 +02:00
parent 0edc50e271
commit a1c36f60d2
2 changed files with 8 additions and 2 deletions

View File

@ -451,9 +451,11 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
) )
self.browser_pid = browser.pid self.browser_pid = browser.pid
# Fix for Chrome 115
# https://github.com/seleniumbase/SeleniumBase/pull/1967
service = selenium.webdriver.chromium.service.ChromiumService( service = selenium.webdriver.chromium.service.ChromiumService(
self.patcher.executable_path executable_path=self.patcher.executable_path,
service_args=["--disable-build-check"]
) )
super(Chrome, self).__init__( super(Chrome, self).__init__(

View File

@ -85,6 +85,10 @@ def get_webdriver(proxy: dict = None) -> WebDriver:
driver_exe_path = "/app/chromedriver" driver_exe_path = "/app/chromedriver"
else: else:
version_main = get_chrome_major_version() version_main = get_chrome_major_version()
# Fix for Chrome 115
# https://github.com/seleniumbase/SeleniumBase/pull/1967
if int(version_main) > 114:
version_main = 114
if PATCHED_DRIVER_PATH is not None: if PATCHED_DRIVER_PATH is not None:
driver_exe_path = PATCHED_DRIVER_PATH driver_exe_path = PATCHED_DRIVER_PATH