Skip to content

Commit f288aed

Browse files
committed
Fix an issue with Chrome 115
1 parent 96ea531 commit f288aed

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

seleniumbase/core/browser_launcher.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,18 @@ def get_uc_driver_version():
153153
return uc_driver_version
154154

155155

156+
def find_driver_version_to_use(use_version):
157+
# Because https://chromedriver.chromium.org/downloads stops at 114
158+
final_chromedriver = "114"
159+
if (
160+
use_version
161+
and use_version.isdigit()
162+
and int(use_version) > int(final_chromedriver)
163+
):
164+
use_version = final_chromedriver
165+
return use_version
166+
167+
156168
def has_cf(text):
157169
if (
158170
"<title>Just a moment...</title>" in text
@@ -2832,14 +2844,15 @@ def get_local_driver(
28322844
elif headless:
28332845
if "--headless" not in chrome_options.arguments:
28342846
chrome_options.add_argument("--headless")
2835-
disable_build_check = False
2847+
disable_build_check = True # True is NEW for Chrome 115 changes!
28362848
uc_driver_version = None
28372849
if is_using_uc(undetectable, browser_name):
28382850
uc_driver_version = get_uc_driver_version()
28392851
if multi_proxy:
28402852
from seleniumbase import config as sb_config
28412853

28422854
sb_config.multi_proxy = True
2855+
use_version = find_driver_version_to_use(use_version)
28432856
if (
28442857
LOCAL_CHROMEDRIVER
28452858
and os.path.exists(LOCAL_CHROMEDRIVER)
@@ -2994,6 +3007,7 @@ def get_local_driver(
29943007
)
29953008
with uc_lock: # Avoid multithreaded issues
29963009
uc_driver_version = get_uc_driver_version()
3010+
use_version = find_driver_version_to_use(use_version)
29973011
if (
29983012
(
29993013
uc_driver_version != use_version
@@ -3168,6 +3182,7 @@ def get_local_driver(
31683182
and int(major_chrome_version) >= 86
31693183
):
31703184
mcv = major_chrome_version
3185+
mcv = find_driver_version_to_use(mcv)
31713186
headless = True
31723187
headless_options = _set_chrome_options(
31733188
browser_name,

seleniumbase/undetected/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,14 @@ def __init__(
287287
if patch_driver:
288288
service_ = selenium.webdriver.chrome.service.Service(
289289
executable_path=self.patcher.executable_path,
290+
service_args=["--disable-build-check"],
290291
port=port,
291292
log_path=os.devnull,
292293
)
293294
else:
294295
service_ = selenium.webdriver.chrome.service.Service(
295296
executable_path=driver_executable_path,
297+
service_args=["--disable-build-check"],
296298
port=port,
297299
log_path=os.devnull,
298300
)

0 commit comments

Comments
 (0)