【发布时间】:2015-12-09 15:45:21
【问题描述】:
我一直在 webdriver 中使用 Firefox。我想尝试使用 Chrome。我已经下载了 chromedriver 并将其包含在 Path 变量中。但是,此代码返回错误:
>>> webdriver.Chrome()
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
我也尝试过包含路径:
>>> webdriver.Chrome('C:\Python34\chromedriver_win32.zip')
OSError: [WinError 193] %1 is not a valid Win32 application
这里有什么问题?如果我做错了什么或者我的问题似乎很难解决,我很抱歉。任何帮助将不胜感激。我也搜索了整个互联网,但我还没有找到任何东西。
说真的,没有人能解决这个问题吗?
【问题讨论】:
-
为简单起见,请将
chromedriver.exe包含在与您的脚本相同的文件夹中。 -
您必须解压 zip 文件夹才能获得必要的
chromedriver.exe -
@malik 似乎有点用。得到一个不同的错误:
-
@ma
selenium.common.exceptions.WebDriverException: Message: 'chromedriver_win32' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home
标签: python google-chrome selenium