【发布时间】:2017-08-01 23:46:01
【问题描述】:
一直在寻找答案,但找不到任何东西。似乎坚持说它找不到指定的文件,然后检查 PATH,但即使这样也看不到它:/ 我已将目录放入 PATH:http://imgur.com/a/ZP59w
程序:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.google.com/")
错误:
Traceback (most recent call last):
File "C:\Users\dilri\AppData\Local\Programs\Python\Python36-32\lib\site- packages\selenium\webdriver\common\service.py", line 74, in start
stdout=self.log_file, stderr=self.log_file)
File "C:\Users\dilri\AppData\Local\Programs\Python\Python36- 32\lib\subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "C:\Users\dilri\AppData\Local\Programs\Python\Python36- 32\lib\subprocess.py", line 990, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "H:\temp.py", line 2, in <module>
driver = webdriver.Chrome()
File "C:\Users\dilri\AppData\Local\Programs\Python\Python36-32\lib\site- packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__
self.service.start()
File "C:\Users\dilri\AppData\Local\Programs\Python\Python36-32\lib\site- packages\selenium\webdriver\common\service.py", line 81, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
如果有人能提供帮助,将不胜感激。
【问题讨论】:
标签: python selenium-chromedriver