mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-06-07 03:25:32 +00:00
Update browser.py
it automatically install chromedriver , if version is outdated or the chromedriver not found.
This commit is contained in:
parent
9d57d0568c
commit
d12b345fe8
@ -5,6 +5,7 @@ from selenium.webdriver.common.by import By
|
|||||||
from selenium.webdriver.support.ui import WebDriverWait
|
from selenium.webdriver.support.ui import WebDriverWait
|
||||||
from selenium.webdriver.support import expected_conditions as EC
|
from selenium.webdriver.support import expected_conditions as EC
|
||||||
from selenium.common.exceptions import TimeoutException, WebDriverException
|
from selenium.common.exceptions import TimeoutException, WebDriverException
|
||||||
|
import chromedriver_autoinstaller
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
@ -36,6 +37,9 @@ class Browser:
|
|||||||
chrome_options.add_argument("--disable-gpu")
|
chrome_options.add_argument("--disable-gpu")
|
||||||
chrome_options.add_argument("--no-sandbox")
|
chrome_options.add_argument("--no-sandbox")
|
||||||
chrome_options.add_argument("--disable-dev-shm-usage")
|
chrome_options.add_argument("--disable-dev-shm-usage")
|
||||||
|
|
||||||
|
# Automatically find ChromeDriver path
|
||||||
|
chromedriver_autoinstaller.install()
|
||||||
# Automatically find ChromeDriver path
|
# Automatically find ChromeDriver path
|
||||||
chromedriver_path = shutil.which("chromedriver")
|
chromedriver_path = shutil.which("chromedriver")
|
||||||
if not chromedriver_path:
|
if not chromedriver_path:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user