1
更新到Firefox 47(這裏說明:https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver)安裝木偶後我的代碼拋出了以下錯誤:硒與提線木偶在Windows上: 「權限被拒絕」
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
,更名爲電線,並嘗試將硒直接指向.exe
文件,但無效
UPDATE 來自:HTTP://stackoverflow.com/questions/37693106/selenium-2-53-not-working-on-firefox-47硒的webdriver 2.53.1已經發布了6月30日2016年上FirefoxDriver是使用Firefox 47.0.1作爲瀏覽器再次工作。 – pmaurais
我實際上有問題,因爲我沒有在這行上使用雙反斜槓'caps ['binary'] =「C:\ Program Files(x86)\ Firefox Developer Edition \」'但是不管你的回答是否讓我升級硒並修復問題 – pmaurais
我試圖運行你的程序,發現這個錯誤,但認爲這是寫錯問題的細節。 – dazzieta