Fix service creation_flag, custom driver path

- selenium.webdriver.common.service cant be used in this situation
- Added check driver path, if not it will ignore the driver_execute_path
This commit is contained in:
Lolmc0587 2023-05-28 08:20:21 +07:00
parent d29b3e300f
commit bd5480e634
2 changed files with 9 additions and 8 deletions

View File

@ -440,7 +440,7 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
self.browser_pid = browser.pid
if service_creationflags:
service = selenium.webdriver.common.service.Service(
service = selenium.webdriver.chrome.service.Service(
self.patcher.executable_path, port, service_args, service_log_path
)
for attr_name in ("creationflags", "creation_flags"):

View File

@ -115,13 +115,14 @@ class Patcher(object):
# self.user_multi_procs != -1:
# # -1 being a skip value used later in this block
#
p = pathlib.Path(self.data_path)
with Lock():
files = list(p.rglob("*chromedriver*?"))
for file in files:
if self.is_binary_patched(file):
self.executable_path = str(file)
return True
if not self._custom_exe_path:
p = pathlib.Path(self.data_path)
with Lock():
files = list(p.rglob("*chromedriver*?"))
for file in files:
if self.is_binary_patched(file):
self.executable_path = str(file)
return True
if executable_path:
self.executable_path = executable_path