From 088e324b88342e8212f4b3ea26d005e5cfa73e7f Mon Sep 17 00:00:00 2001 From: ganesh nikhil <73976037+ganeshnikhil@users.noreply.github.com> Date: Tue, 18 Mar 2025 23:07:39 +0530 Subject: [PATCH] Update browser.py added both methods, for support for beta to. --- sources/browser.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sources/browser.py b/sources/browser.py index d0190bf..1c1c566 100644 --- a/sources/browser.py +++ b/sources/browser.py @@ -8,6 +8,7 @@ from selenium.common.exceptions import TimeoutException, WebDriverException import chromedriver_autoinstaller import time import os +import shutil from bs4 import BeautifulSoup import markdownify import logging @@ -36,9 +37,12 @@ class Browser: chrome_options.add_argument("--disable-gpu") chrome_options.add_argument("--no-sandbox") chrome_options.add_argument("--disable-dev-shm-usage") - - # Automatically install or find ChromeDriver path. - chromedriver_path = chromedriver_autoinstaller.install() + # Automatically install or find ChromeDriver path.(for google chrome and chrome beta). + try: + chromedriver_path = chromedriver_autoinstaller.install() + except FileNotFoundError as e: + 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)