launch selenium from python on ubuntu
<p>I have the following script</p>

<pre><code>from selenium import webdriver

browser = webdriver.Firefox()
browser.get('http://localhost:8000')

assert 'Django' in browser.title
</code></pre>

<p>I get the following error</p>

<pre><code>$ python3 functional_tests.py 
Traceback (most recent call last):   File "functional_tests.py", line 3, in &lt;module&gt;
    browser = webdriver.Firefox()   File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/webdriver.py", line 80, in __init__
    self.binary, timeout)   File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__
    self.binary.launch_browser(self.profile, timeout=timeout)   File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
    self._wait_until_connectable(timeout=timeout)   File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 99, in _wait_until_connectable
    "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.
</code></pre>

<p><code>pip3 list</code> shows <code>selenium (2.53.6)</code>.</p>

<p><code>firefox -v</code> shows <code>Mozilla Firefox 47.0</code>.</p>

<p>The last version of Firefox is not working properly with selenium. Try with 46 or 45. </p>

<p>You can download here: ftp.mozilla.org/pub/firefox/releases</p>

<p>or <code>sudo apt-get install firefox=45.0.2+build1-0ubuntu1</code></p>

python selenium ubuntu