更新到 Firefox 47 并安装 Marionette(此处的说明:https ://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver )后,我的代码抛出以下错误:
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.keys import Keys
#firefox requires a new webdriver code-named marionette
#Selenium must be told to use said driver (not necessary in the future)
caps= DesiredCapabilities.FIREFOX
caps["marionette"]=True
#STABLE RELESE NOT SUPPORTED USE DEV EDITION
caps['binary']="C:\Program Files (x86)\Firefox Developer Edition\"
driver=webdriver.Firefox(capabilities=caps)
抛出:
Traceback (most recent call last):
driver=webdriver.Firefox(capabilities=caps)
response = self.execute(Command.NEW_SESSION, capabilities)
self.error_handler.check_response(response)
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: permission
denied
我已将 Marionette 添加到我的PATH
,重命名为电线,并尝试将 selenium 直接指向.exe
文件但无济于事