Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Firefox 50出现Selenium 3.0.2错误:可执行文件可能具有错误的权限_Python_Windows_Selenium_Firefox_Geckodriver - Fatal编程技术网

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

Python Firefox 50出现Selenium 3.0.2错误:可执行文件可能具有错误的权限,python,windows,selenium,firefox,geckodriver,Python,Windows,Selenium,Firefox,Geckodriver,我正在尝试在Windows7中将Selenium 3.0.2与Firefox 50.0.1结合使用。我已经按照post中的说明正确设置了驱动程序和路径,但出现以下错误: Traceback (most recent call last): File "ixps-bgp.he.net.py", line 38, in <module> browser = webdriver.Firefox(firefox_binary=binary,capabilities=caps, e

我正在尝试在Windows7中将Selenium 3.0.2与Firefox 50.0.1结合使用。我已经按照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
回溯(最近一次呼叫最后一次):
文件“ixps bgp.he.net.py”,第38行,在
浏览器=webdriver.Firefox(Firefox\u binary=binary,功能=caps,可执行路径=“”)
文件“C:\Users\\AppData\Local\Continuum\Anaconda2\lib\site packages\selenium\webdriver\firefox\webdriver.py”,第140行,在\uu init中__
self.service.start()
文件“C:\Users\\AppData\Local\Continuum\Anaconda2\lib\site packages\selenium\webdriver\common\service.py”,第86行,开始处
os.path.basename(self.path)、self.start\u错误消息)
selenium.common.exceptions.WebDriverException:消息:“”可执行文件可能具有错误的权限。
异常AttributeError:“服务”对象在忽略中没有属性“进程”

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

您应该使用整个exe地址。如果只传递文件夹,则会出现问题

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

谢谢这修复了它,它可以与ChromeWebDriver和Firefox的geckodriver一起使用。