首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >selenium.common.exceptions.WebDriverException:消息:使用GeckoDriver时,'Mozilla Firefox‘可执行文件可能具有错误的权限

selenium.common.exceptions.WebDriverException:消息:使用GeckoDriver时,'Mozilla Firefox‘可执行文件可能具有错误的权限
EN

Stack Overflow用户
提问于 2018-06-09 03:31:26
回答 1查看 1.1K关注 0票数 0

我在尝试让selenium与浏览器一起工作时遇到了一些麻烦。我是一个超级新手,但我仍然在搜索,我找到的最恰当的回答是我需要以管理员身份运行应用程序,但这并没有改变任何事情。下面是我的代码和错误消息。非常感谢。

代码语言:javascript
复制
import time
from selenium import webdriver
driver = webdriver.Firefox(executable_path="C:\Program Files\Mozilla Firefox")

我的错误消息:

代码语言:javascript
复制
Traceback (most recent call last):
  File "C:\Users\Axel\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
    stdin=PIPE)
  File "C:\Users\Axel\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Axel\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 997, in _execute_child
    startupinfo)
PermissionError: [WinError 5] Access is denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Axel\Desktop\PYTHON\code.py", line 3, in <module>
    driver = webdriver.Firefox(executable_path="C:\Program Files\Mozilla Firefox")
  File "C:\Users\Axel\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 160, in __init__
    self.service.start()
  File "C:\Users\Axel\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 88, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'Mozilla Firefox' executable may have wrong permissions. 

我非常确定这两个错误只是一个,我已经经历了一大堆线索,但我从来没有正确地理解过一些事情。我想知道它是否与geckdriver有关(我没有,也不知道如何安装)。非常感谢!

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50767308

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档