小工具知识网

当前位置: 首页 > 行业知识 > TypeError: WebDriver.

行业知识

TypeError: WebDriver.

2026-11-01 16:19:31 来源:互联网转载

selenium调���chromedriver报错,之前是可以用的,今天升级了一下selenium=4.11,搜了一下原来是selenium4.10开始不支持executeable_path参数了,需要使用service参数代替

()

相关代码需要修改为:

from selenium.webdriver.chrome.service import Servicechromedriver_path = "{}\chromedriver.exe".format(os.path.dirname(os.path.abspath(__file__)))  #指定chromedriver路径chrome_options = webdriver.ChromeOptions()driver=webdriver.Chrome(service=Service(chromedriver_path), options=chrome_options)
()

上一篇:教你轻松删除苹果手机共用ID账号,一部手机搞定!

下一篇:Android Studio安装SDK时报错:SDK emulator directory is missing