removed executable_path in favor of browser_executable_path

This makes it easier , when needed, in edge cases , to specify your browser executable.
This commit is contained in:
Leon 2021-12-21 16:42:09 +00:00 committed by GitHub
parent 8a3870bd6d
commit abac314741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -100,7 +100,7 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
def __init__( def __init__(
self, self,
user_data_dir=None, user_data_dir=None,
executable_path=None, browser_executable_path=None,
port=0, port=0,
options=None, options=None,
enable_cdp_events=False, enable_cdp_events=False,
@ -126,8 +126,9 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
if user_data_dir is a path to a valid chrome profile directory, use it, if user_data_dir is a path to a valid chrome profile directory, use it,
and turn off automatic removal mechanism at exit. and turn off automatic removal mechanism at exit.
executable_path: str, optional, default: None - use find_chrome_executable browser_executable_path: str, optional, default: None - use find_chrome_executable
Path to the executable. If the default is used it assumes the executable is in the $PATH Path to the browser executable.
If not specified, make sure the executable's folder is in $PATH
port: int, optional, default: 0 port: int, optional, default: 0
port you would like the service to run, if left as 0, a free port will be found. port you would like the service to run, if left as 0, a free port will be found.
@ -177,7 +178,7 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
""" """
patcher = Patcher( patcher = Patcher(
executable_path=executable_path, executable_path=None,
force=patcher_force_close, force=patcher_force_close,
version_main=version_main, version_main=version_main,
) )
@ -270,10 +271,10 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
language = "en-US" language = "en-US"
options.add_argument("--lang=%s" % language) options.add_argument("--lang=%s" % language)
if not options.binary_location: if not options.binary_location:
options.binary_location = find_chrome_executable() options.binary_location = browser_executable_path or find_chrome_executable()
self._delay = delay self._delay = delay
self.user_data_dir = user_data_dir self.user_data_dir = user_data_dir