【发布时间】:2021-06-16 09:08:09
【问题描述】:
我正在尝试使用 Python 和 selenium 进行网络爬虫,但遇到了如下错误:
Traceback (most recent call last):
File "C:/Users/You/your_code.py", line 5, in <module>
driver = webdriver.Chrome(executable_path='c:\path\to\windows\webdriver\executable.exe')
File "C:\Users\You\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
self.service.start()
File "C:\Users\You\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'executable.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
似乎我没有正确安装 chromedriver for selenium。如何为 selenium 正确安装 chromedriver?
【问题讨论】:
标签: python windows selenium selenium-chromedriver chocolatey