From d12b345fe83b555df8832fa841b430d0573fe241 Mon Sep 17 00:00:00 2001 From: ganesh nikhil <73976037+ganeshnikhil@users.noreply.github.com> Date: Tue, 18 Mar 2025 20:41:51 +0530 Subject: [PATCH] Update browser.py it automatically install chromedriver , if version is outdated or the chromedriver not found. --- sources/browser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/browser.py b/sources/browser.py index 9a5acd3..add58c0 100644 --- a/sources/browser.py +++ b/sources/browser.py @@ -5,6 +5,7 @@ from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException, WebDriverException +import chromedriver_autoinstaller import time import os import shutil @@ -36,6 +37,9 @@ class Browser: chrome_options.add_argument("--disable-gpu") 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") if not chromedriver_path: