小编ome*_*rsk的帖子

启动Firefox时出现python webdriver错误

我最近下载了selenium并尝试运行此脚本:

 from selenium import webdriver
 driver = webdriver.Firefox()
Run Code Online (Sandbox Code Playgroud)

但我得到这个错误:

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    driver = webdriver.Firefox()
  File "C:\Heights\PortableApps\PortablePython2.7.6.1\App\lib\site-packages\selenium-3.0.1-py2.7.egg\selenium\webdriver\firefox\webdriver.py", line 145, in __init__
    keep_alive=True)
  File "C:\Heights\PortableApps\PortablePython2.7.6.1\App\lib\site-packages\selenium-3.0.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 92, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "C:\Heights\PortableApps\PortablePython2.7.6.1\App\lib\site-packages\selenium-3.0.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 179, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "C:\Heights\PortableApps\PortablePython2.7.6.1\App\lib\site-packages\selenium-3.0.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "C:\Heights\PortableApps\PortablePython2.7.6.1\App\lib\site-packages\selenium-3.0.1-py2.7.egg\selenium\webdriver\remote\errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
WebDriverException: Message: Expected browser binary location, but unable to find binary in default location, no …
Run Code Online (Sandbox Code Playgroud)

python selenium webdriver path

4
推荐指数
1
解决办法
6165
查看次数

标签 统计

path ×1

python ×1

selenium ×1

webdriver ×1