刚刚升级到 selenium 4.10 并得到: 类型错误:init() 获得意外的关键字参数“executable_path”
我读到最新版本不需要可执行路径,修复方法是:
from selenium.webdriver.chrome.service import Service
service = Service("C:\\Users\\user1\\documents\\selenium\\chromedriver.exe")
self.driver = webdriver.Chrome(service=service)
这工作正常,但是当我使用未检测到的 chromedriver 尝试相同的操作时,我收到原始错误
from selenium.webdriver.chrome.service import Service
service = Service("C:\\Users\\user1\\documents\\selenium\\chromedriver.exe")
self.driver = uc.Chrome(service=service, use_subprocess=True)
File "C:\python38\lib\site-packages\undetected_chromedriver\__init__.py", line 453, in __init__
super(Chrome, self).__init__(
TypeError: __init__() got an unexpected keyword argument 'executable_path'`
最佳答案
我对 python 也有同样的问题。 Selnium 4.10 似乎有问题。请使用selenium 4.9。
关于undetected-chromedriver - 未检测到的 chromedriver 无法与 selenium 4.10 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76429956/