From 0616f39e35d46be68cca2942e4ef28e27b84eaaa Mon Sep 17 00:00:00 2001 From: martin legrand Date: Mon, 17 Mar 2025 21:04:25 +0100 Subject: [PATCH] Fix : google chrome beta support on macos --- sources/browser.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sources/browser.py b/sources/browser.py index 9a5acd3..11556c2 100644 --- a/sources/browser.py +++ b/sources/browser.py @@ -38,10 +38,12 @@ class Browser: chrome_options.add_argument("--disable-dev-shm-usage") # Automatically find ChromeDriver path chromedriver_path = shutil.which("chromedriver") - if not chromedriver_path: - raise FileNotFoundError("ChromeDriver not found. Please install it or add it to your PATH.") service = Service(chromedriver_path) - self.driver = webdriver.Chrome(service=service, options=chrome_options) + if chromedriver_path: + self.driver = webdriver.Chrome(service=service, options=chrome_options) + else: + self.driver = webdriver.Chrome(service=service) + #raise FileNotFoundError("ChromeDriver not found. Please install it or add it to your PATH.") self.wait = WebDriverWait(self.driver, 10) self.logger = logging.getLogger(__name__) self.logger.info("Browser initialized successfully") @@ -57,7 +59,7 @@ class Browser: os.path.join(os.environ.get("LOCALAPPDATA", ""), "Google\\Chrome\\Application\\chrome.exe") # User install ] elif sys.platform.startswith("darwin"): # macOS - paths = ["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"] + paths = ["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", "/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta"] else: # Linux paths = ["/usr/bin/google-chrome", "/usr/bin/chromium-browser", "/usr/bin/chromium"]