m0_56691628 2021-04-10 21:46 采纳率: 0%
浏览 117

使用pycharm打开火狐浏览器报错,有大佬说说是什么问题么?

Traceback (most recent call last):
  File "D:/web自动化/scripts.py", line 4, in <module>
    driver = webdriver.Firefox()
  File "D:\python\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 174, in __init__
    keep_alive=True)
  File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "D:\python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line
 

  • 写回答

2条回答 默认 最新

  • CSDN专家-孙老师 2021-04-10 22:44
    关注

    根据错误提示,unable to find binary in default location,未找到浏览器的位置。

    检查一下,下载的ChromeDriver配置环境变量了没。

     

    评论

报告相同问题?