[PYTHON] Selenium stopped working after updating Firefox

Environment before update

OS: Ubuntu 14.04 Firefox: 46.0.1 ** selenium: ** 2.53.5 (Python version)

Updated environment

Firefox: 47.0 No change in OS and selenium versions.

When I ran my own Python command, I got the following error:

selenium error message


Traceback (most recent call last):
(Abbreviation)......
    raise WebDriverException("The browser appears to have exited "
selenium.common.exceptions.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.

It worked fine before the Firefox upgrade ...

prescription

** Choice 1: Downgrade to Firefox 46.0.1 ** Choices as of 6/12 when this article was posted.

** Option 2: Upgrade to Firefox 47.0.1 ** Information from yasunori who commented on this article, After updating to 47.0.1, Selenium will work.

Downgrade to Firefox 46.0.1

Get the old version of Firefox from the page below.

Installation

  1. Unzip the compressed file. tar jxf firefox*.tar.bz2 -C $HOME

  2. Terminate all Firefox processes.

  3. Run ~ / firefox / firefox -ProfileManager.

  4. Create a new profile> Select the created profile> Use this profile in the future> Launch Firefox

  5. Run sudo apt-get purge firefox Uninstall Firefox 47.0.

PATH setting

Add the following to .bashrc.

~/.bashrc


export PATH=$HOME/firefox:$PATH

Firefox settings change

Settings> Advanced> Do not check for updates (deprecated: security risk)

If you forget this, you will end up updating to Firefox 47.0, selenium gets stuck.

Note: "Check for updates, but choose whether to install" There is also an option, but if you do this, it will be Windows 10 A notification will appear saying "Please update".

Of course, it is dangerous to leave it for a long time without confirming the update, so That selenium is a temporary breakthrough until it is compatible with Firefox 47.0 Don't forget !!

Upgrade to Firefox 47.0.1

7/29 I tried it in my environment (Ubuntu 14.04). Normally it should be updated with `ʻapt-get upgrade``, Even if I run it, Firefox 47.0 remains ... Maybe the version is fixed according to Linux principles and It's probably not recognized as a security update on the Ubuntu side.

I couldn't help it, so I decided to download the package from the following page.

Installation and PATH settings

Same procedure as when downgrading.

Side effects

Firefox goes out of control of apt-get. I think that there is no problem because Firefox itself has an automatic update function, Those who say "That's a problem !!" should switch to PhantomJS.

Recommended Posts

Selenium stopped working after updating Firefox
Python: Working with Firefox with selenium
Mercurial stopped working after migrating from Python 2 to Python 3 (Note)
Selenium WebDriver + Firefox49 (provisional) (Python)