Firefox 50 的 Selenium 3.0.2 错误:可执行文件可能具有错误的权限

Selenium 3.0.2 error with Firefox 50: executable may have wrong permissions

我正在尝试在 Windows 中将 Selenium 3.0.2 与 Firefox 50.0.1 一起使用 7. 我已按照 this post 中的说明正确设置驱动程序和路径,但我收到以下错误:

Traceback (most recent call last):
  File "ixps-bgp.he.net.py", line 38, in <module>
    browser = webdriver.Firefox(firefox_binary=binary,capabilities=caps, executable_path='<path to gecko driver>')
  File "C:\Users\<myusername>\AppData\Local\Continuum\Anaconda2\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 140, in __init__
    self.service.start()
  File "C:\Users\<myusername>\AppData\Local\Continuum\Anaconda2\lib\site-packages\selenium\webdriver\common\service.py", line 86, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: '' executable may have wrong permissions.

Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x00000000023BA240>> ignored

即使我尝试以管理员身份执行脚本,我仍然会收到上述错误。我使用的是最新版本的 gecko 驱动程序 (0.13),我尝试了 64 位和 32 位版本。这是任何当前版本的已知问题吗?

您应该使用整个 exe 地址。如果你只传递文件夹,你就会遇到问题。

>>>chromepath = "C:\Dev\chromedriver.exe"
>>>driver = webdriver.Chrome(chromepath)