url-chromedriver没有此驱动程序

f8rj6qna  于 2023-08-01  发布在  Go
关注(0)|答案(1)|浏览(113)

亲爱的
能帮我解决这个问题吗?我的浏览器在运行期间不再打开。非常感谢您的光临。
我从昨天开始就得到了以下错误:
第一个月
我的代码看起来像这样的开始:

import pyautogui
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
from pynput.keyboard import Key, Controller
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

options = Options()
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)```

字符串

v9tzhpje

v9tzhpje1#

selenium4.10.0和更新版本包含驱动程序管理器,所以您可以这样做:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service

service = Service()
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)
# ...
driver.quit()

字符串
如果在您的系统PATH中找不到驱动程序,Selenium Manager将自动下载它。
如果你想知道为什么你现在看到错误的ChromeDriverManager,这是因为https://chromedriver.chromium.org/downloads只上升到版本114由于驱动程序重组由Chromium团队为新的Chrome-for-Testing
还有SeleniumBase Python selenium框架,它已经在最新版本中修复了Chrome 115问题:(在pip install seleniumbase之后,使用python运行以下操作):

from seleniumbase import Driver

driver = Driver(browser="chrome", headless=False)
# ...
driver.quit()

相关问题