How to fix Selenium WebDriverException: "The browser appears to have exited"

parik picture parik · Jun 28, 2016 · Viewed 9.9k times · Source

I got this exception when I want to use FireFox webdriver

raise WebDriverException "The browser appears to have exited " WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.

I read this question and updated my selenium, but I already have the same problem.

my code :

driver = webdriver.Firefox()
time.sleep(5)
driver.get('http://www.example.com')

UPDATE

I read this question

and now I have this error

OSError: [Errno 20] Not a directory
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x407a690>> ignored

Answer

benjaoming picture benjaoming · Jul 27, 2016

If you're running Selenium on Firefox 47.0, you need to update to Firefox 47.0.1 which is not released in Ubuntu's main repos.. so you have to add this PPA: https://launchpad.net/~ubuntu-mozilla-security/+archive/ubuntu/ppa

Release notes: https://www.mozilla.org/en-US/firefox/47.0.1/releasenotes/

"Selenium WebDriver may cause Firefox to crash at startup"

Once Firefox 48.0 is out, it will include the fix. I think Ubuntu has skipped this update because it affects very few users.

I can confirm the error with FF 47.0 and Selenium 2.53, and I can also confirm that upgrading to FF 47.0.1 fixes the error.