【问题标题】:Selenium 3.0.2 error with Firefox 50: executable may have wrong permissionsFirefox 50 的 Selenium 3.0.2 错误:可执行文件可能有错误的权限
【发布时间】:2017-06-14 16:01:01
【问题描述】:

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

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

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

【问题讨论】:

    标签: python windows selenium firefox geckodriver


    【解决方案1】:

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

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

    【讨论】:

    • 谢谢!这修复了它,它适用于 Chrome 网络驱动程序和 Firefox 的壁虎驱动程序。
    猜你喜欢
    • 1970-01-01
    • 2019-02-17
    • 2018-03-22
    • 2018-09-22
    • 2022-01-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-17
    相关资源
    最近更新 更多