diff --git a/seleniumbase/__version__.py b/seleniumbase/__version__.py index edaa71ccb98..7de72f77c61 100755 --- a/seleniumbase/__version__.py +++ b/seleniumbase/__version__.py @@ -1,2 +1,2 @@ # seleniumbase package -__version__ = "4.44.0" +__version__ = "4.44.1" diff --git a/seleniumbase/core/browser_launcher.py b/seleniumbase/core/browser_launcher.py index 9ff1e9c5370..07cc8b12a50 100644 --- a/seleniumbase/core/browser_launcher.py +++ b/seleniumbase/core/browser_launcher.py @@ -2618,15 +2618,20 @@ def _set_chrome_options( if is_using_uc(undetectable, browser_name): chrome_options.add_argument("--disable-application-cache") chrome_options.add_argument("--disable-setuid-sandbox") - if not binary_location: + if not binary_location: + if os.path.exists("/bin/google-chrome"): + binary_location = "/bin/google-chrome" + elif os.path.exists("/usr/bin/google-chrome-stable"): + binary_location = "/usr/bin/google-chrome-stable" + elif os.path.exists("/usr/bin/google-chrome"): + binary_location = "/usr/bin/google-chrome" + elif os.path.exists("/usr/bin/google-chrome-stable"): + binary_location = "/usr/bin/google-chrome-stable" + else: br_app = "google-chrome" binary_loc = detect_b_ver.get_binary_location(br_app, True) if os.path.exists(binary_loc): binary_location = binary_loc - elif os.path.exists("/usr/bin/google-chrome-stable"): - binary_location = "/usr/bin/google-chrome-stable" - elif os.path.exists("/usr/bin/google-chrome"): - binary_location = "/usr/bin/google-chrome" extra_disabled_features = [] if chromium_arg: # Can be a comma-separated list of Chromium args or a list diff --git a/seleniumbase/core/detect_b_ver.py b/seleniumbase/core/detect_b_ver.py index 58963886e38..acc19ae6d51 100644 --- a/seleniumbase/core/detect_b_ver.py +++ b/seleniumbase/core/detect_b_ver.py @@ -105,10 +105,22 @@ def chrome_on_linux_path(chromium_ok=False, browser_type=None): return "" if os_name() != OSType.LINUX: return "" - paths = ["/bin/google-chrome", "/bin/google-chrome-stable"] + paths = [ + "/bin/google-chrome", + "/bin/google-chrome-stable", + "/usr/bin/google-chrome", + "/usr/bin/google-chrome-stable" + ] for path in paths: - if os.path.exists(path) and os.access(path, os.X_OK): - return path + try: + if ( + os.path.exists(path) + and os.access(path, os.R_OK) + and os.access(path, os.X_OK) + ): + return path + except Exception: + pass paths = os.environ["PATH"].split(os.pathsep) binaries = [] binaries.append("google-chrome") @@ -122,13 +134,32 @@ def chrome_on_linux_path(chromium_ok=False, browser_type=None): for binary in binaries: for path in paths: full_path = os.path.join(path, binary) - if os.path.exists(full_path) and os.access(full_path, os.X_OK): - return full_path + try: + if ( + os.path.exists(full_path) + and os.access(full_path, os.R_OK) + and os.access(full_path, os.X_OK) + ): + return full_path + except Exception: + pass if chromium_ok: - paths = ["/bin/chromium", "/bin/chromium-browser"] + paths = [ + "/bin/chromium", + "/bin/chromium-browser", + "/usr/bin/chromium", + "/usr/bin/chromium-browser" + ] for path in paths: - if os.path.exists(path) and os.access(path, os.X_OK): - return path + try: + if ( + os.path.exists(path) + and os.access(path, os.R_OK) + and os.access(path, os.X_OK) + ): + return path + except Exception: + pass return "/usr/bin/google-chrome" diff --git a/setup.py b/setup.py index 93ef5b3c836..2cbdb91a9f9 100755 --- a/setup.py +++ b/setup.py @@ -307,7 +307,7 @@ ], # pip install -e .[psutil] "psutil": [ - "psutil==7.1.0", + "psutil==7.1.2", ], # pip install -e .[pyautogui] # (Already a required dependency on Linux now.)