我们在学习爬虫中如果出现这个错误:
Traceback (most recent call last):
File “E:/pythonwork/第三阶段/day06/1.selenium结合Chrome浏览器.py”, line 18, in
driver = webdriver.Chrome(executable_path=r’E:\软\chromedriver_win32\chromedriver.exe’, options=options)
TypeError: init() got an unexpected keyword argument ‘options’
解决的方案就是:pip install selenium --upgrade (可能是版本不正确,需要更新一下版本。)
本文介绍了在使用Python的Selenium库时遇到的一个常见错误及其解决方案。错误出现在尝试使用带有'选项'参数初始化Chrome WebDriver时,提示TypeError。文章提供了解决方法:通过升级Selenium到最新版本来修正此问题。
8万+





