currently, chromedriver 114.0.5735.90 is recommended for chrome 114.*, so it is advised to delete the driver in PATH and retry

报错原因是驱动和浏览器不匹配

解决办法

1.下载低版本的谷歌浏览器   本次使用的是114   

下载地址:

https://downzen.com/en/windows/google-chrome/download/11405735199/

 如果自己电脑是64位需要下载64位

 

2.下载谷歌浏览器的插件

https://registry.npmmirror.com/binary.html?path=chromedriver/114.0.5735.90/

 验证

# 导包
from time import sleep
from selenium import webdriver
# 实例化浏览器
driver = webdriver.Chrome()
# 打开网址
driver.get('https://cn.bing.com')
sleep(3)
driver.find_element("id","sb_form_q").send_keys("未知\n")
# 等待3秒
sleep(3)
# 关闭页面
driver.quit()

完结散花

posted @ 2023-09-22 12:14  胖豆芽  阅读(2797)  评论(0编辑  收藏  举报