首页 > 解决方案 > 下载了 chromeDriver 但我的 Visual Studio 代码仍然要求我下载 chromeDriver

问题描述

Traceback(最近一次调用最后):文件“c:/Users/et_on/Documents/Eoyzyc's Code/AMZN_Search_TC_001.py”,第 4 行,在 driver = webdriver.Chrome('/path/to/chromedriver') # 可选参数,如果未指定将搜索路径。文件“C:\Users\et_on\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py”,第 73 行,在init self.service.start()文件“C:\Users\et_on\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\common\service.py”,第 81 行,开始引发 WebDriverException(selenium.common. exceptions.WebDriverException:消息:“chromedriver”可执行文件需要在 PATH 中。请参阅https://sites.google.com/a/chromium.org/chromedriver/home

标签: seleniumselenium-chromedriver

解决方案


将路径添加到 chromedriver.exe 找到的位置。

如果文档上有 chromedriver.exe:您可以添加到路径,例如:C:\Users\User\Documents

如何添加到路径:https ://docs.oracle.com/en/database/oracle/r-enterprise/1.5.1/oread/creating-and-modifying-environment-variables-on-windows.html


推荐阅读