From 07a04b069ea756ab1defe51ed85597b9742395d9 Mon Sep 17 00:00:00 2001 From: ganesh nikhil <73976037+ganeshnikhil@users.noreply.github.com> Date: Tue, 18 Mar 2025 20:49:26 +0530 Subject: [PATCH] Update browser.py update the code to remove overhead of check and install chromedriver. --- sources/browser.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sources/browser.py b/sources/browser.py index add58c0..d0190bf 100644 --- a/sources/browser.py +++ b/sources/browser.py @@ -8,7 +8,6 @@ from selenium.common.exceptions import TimeoutException, WebDriverException import chromedriver_autoinstaller import time import os -import shutil from bs4 import BeautifulSoup import markdownify import logging @@ -38,10 +37,8 @@ class Browser: chrome_options.add_argument("--no-sandbox") chrome_options.add_argument("--disable-dev-shm-usage") - # Automatically find ChromeDriver path - chromedriver_autoinstaller.install() - # Automatically find ChromeDriver path - chromedriver_path = shutil.which("chromedriver") + # Automatically install or find ChromeDriver path. + chromedriver_path = chromedriver_autoinstaller.install() if not chromedriver_path: raise FileNotFoundError("ChromeDriver not found. Please install it or add it to your PATH.") service = Service(chromedriver_path)