我之前在 Linux 机器上使用 chromedriver 的一个应用程序,现在我将应用程序切换到了 Windows 10 机器上。但是现在突然告诉我找不到 chromedriver 文件。
以下是错误信息:
Selenium::WebDriver::Error::WebDriverError in Static#home
Showing C:/Users/User/Documents/test_app/app/views/static/home.html.erb where line #4 raised:
Unable to find chromedriver. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.
我已将chromedriver文件放在与Linux机器上相同的位置,即应用程序的主文件夹中。在这种情况下,路径为
C:\Users\User\Document\test_app
。Windows是否和Linux不同解释路径?chromedriver是最新版。它的标题是“chromedriver_win32.zip”。 “win”表示Windows。 “32”是否意味着它适用于32位系统?我的机器是64位的。
PATH
是指环境变量。你遇到的问题可能是因为当前目录不是C:\Users\User\Document\test_app
。 - Florent B.