diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-01-21 02:18:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-21 02:18:00 +0100 |
commit | a98a9e92bcfaac7a364a9ea093ae42af9237fc88 (patch) | |
tree | f6e33c929444ccea288257664ecbe9655650fac1 /g4f/webdriver.py | |
parent | Merge pull request #1485 from Eikosa/patch-3 (diff) | |
parent | Fix permissions (diff) | |
download | gpt4free-a98a9e92bcfaac7a364a9ea093ae42af9237fc88.tar gpt4free-a98a9e92bcfaac7a364a9ea093ae42af9237fc88.tar.gz gpt4free-a98a9e92bcfaac7a364a9ea093ae42af9237fc88.tar.bz2 gpt4free-a98a9e92bcfaac7a364a9ea093ae42af9237fc88.tar.lz gpt4free-a98a9e92bcfaac7a364a9ea093ae42af9237fc88.tar.xz gpt4free-a98a9e92bcfaac7a364a9ea093ae42af9237fc88.tar.zst gpt4free-a98a9e92bcfaac7a364a9ea093ae42af9237fc88.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/webdriver.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/g4f/webdriver.py b/g4f/webdriver.py index 9a83215f..85d6d695 100644 --- a/g4f/webdriver.py +++ b/g4f/webdriver.py @@ -6,6 +6,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 os import path +from os import access, R_OK from . import debug try: @@ -40,8 +41,9 @@ def get_browser( options = ChromeOptions() if proxy: options.add_argument(f'--proxy-server={proxy}') + # Check for system driver in docker driver = '/usr/bin/chromedriver' - if not path.isfile(driver): + if not path.isfile(driver) or not access(driver, R_OK): driver = None return Chrome( options=options, |