Chromedriver:“FileNotFoundError:[WinError 2]系统找不到指定的文件”E

2024-10-01 11:39:19 发布

您现在位置:Python中文网/ 问答频道 /正文

一直在寻找答案,但什么也找不到。它似乎坚持说找不到指定的文件,然后检查路径,但即使这样也看不到:/I已经将目录放在路径:http://imgur.com/a/ZP59w

课程:

from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.google.com/")

错误:

^{pr2}$

如果有人能帮忙,我将不胜感激。在


Tags: 文件答案fromimport路径目录comhttp
2条回答

我也遇到了同样的问题,用期权法解决了。在

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.binary_location = "C:\Program Files (x86)\Google\Chrome Dev\Application\chrome.exe"
driver = webdriver.Chrome(chrome_options=options, executable_path=r"C:\Program Files (x86)\Google\chromedriver.exe", )
driver.get("https://www.google.com/")

希望它能解决你的问题。在

你可以试着直接走过这条路。在

我的dekstop上有webdriver文件,所以:

webdriver.Chrome('C:/Users/adam/Desktop/chromedriver.exe')

您可以获得webdriverhere.

相关问题 更多 >