From 5c75972c50ac936cb6dc8e01cef9cdb08daa8ed7 Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Fri, 9 Feb 2024 14:24:15 +0100 Subject: Update provider and model list (#1568) Move bing.create_images and cookies helper Disable some providers --- g4f/webdriver.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'g4f/webdriver.py') diff --git a/g4f/webdriver.py b/g4f/webdriver.py index d28cd97b..b54fae15 100644 --- a/g4f/webdriver.py +++ b/g4f/webdriver.py @@ -9,6 +9,7 @@ try: from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.keys import Keys + from selenium.common.exceptions import NoSuchElementException has_requirements = True except ImportError: from typing import Type as WebDriver @@ -120,6 +121,8 @@ def bypass_cloudflare(driver: WebDriver, url: str, timeout: int) -> None: WebDriverWait(driver, 5).until( EC.presence_of_element_located((By.CSS_SELECTOR, "#challenge-stage input")) ).click() + except NoSuchElementException: + ... except Exception as e: if debug.logging: print(f"Error bypassing Cloudflare: {e}") -- cgit v1.2.3