Python selenium error when trying to launch firefox

前端 未结 8 1351
时光取名叫无心
时光取名叫无心 2020-12-01 16:35

I am getting an error when trying to open Firefox using Selenium in ipython notebook. I\'ve looked around and have found similar errors but nothing that exactly matches the

8条回答
  •  温柔的废话
    2020-12-01 16:50

    Try specify your Firefox binary when initialize Firefox()

    from selenium import webdriver
    from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
    
    binary = FirefoxBinary('path/to/binary')
    driver = webdriver.Firefox(firefox_binary=binary)
    

    The default path FirefoxDriver looking for is at %PROGRAMFILES%\Mozilla Firefox\firefox.exe. See FirefoxDriver

    Or add your path of Firefox binary to Windows' PATH.

提交回复
热议问题