From 153bd21910cf77c67b540bee5b70c349d0989004 Mon Sep 17 00:00:00 2001 From: martin legrand Date: Wed, 16 Apr 2025 14:10:48 +0200 Subject: [PATCH] feat : custom chhrome path save to env --- sources/browser.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sources/browser.py b/sources/browser.py index e9e181d..677054c 100644 --- a/sources/browser.py +++ b/sources/browser.py @@ -46,8 +46,13 @@ def get_chrome_path() -> str: return path print("Looking for Google Chrome in these locations failed:") print('\n'.join(paths)) + chrome_path_env = os.environ.get("CHROME_EXECUTABLE_PATH") + if chrome_path_env and os.path.exists(chrome_path_env) and os.access(chrome_path_env, os.X_OK): + return chrome_path_env path = input("Google Chrome not found. Please enter the path to the Chrome executable: ") if os.path.exists(path) and os.access(path, os.X_OK): + os.environ["CHROME_EXECUTABLE_PATH"] = path + print(f"Chrome path saved to environment variable CHROME_EXECUTABLE_PATH") return path return None