Firefox blank webbrowser with selenium
<p>When I call a firefox webbrowser with python firefox webdriver, the firefox is opening with a blank page (nothing in the navigation barre), wait and close.</p>

<p>The python consol give me this error :</p>

<p>Traceback (most recent call last):
  File "firefox_selenium2.py", line 4, in 
    driver = webdriver.Firefox()
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/webdriver.py", line 80, in <strong>init</strong>
    self.binary, timeout)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in <strong>init</strong>
    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 108, in _wait_until_connectable
    % (self.profile.path))
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: /tmp/tmpngm7g76x If you specified a log_file in the FirefoxBinary constructor, check it for details.</p>

<p>My code is the exemple from the python selenium read_the_doc :
from selenium import webdriver
from selenium.webdriver.common.keys import Keys</p>

<pre><code>driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
</code></pre>

<p>Any help would be appreciated</p>

<p>PS : firefox version 49
selenium version 2.53.6
python 3.5</p>

<p>According to this post
<a href="https://github.com/SeleniumHQ/selenium/issues/2739#issuecomment-249479530" rel="nofollow">https://github.com/SeleniumHQ/selenium/issues/2739#issuecomment-249479530</a>
the is that you need to use something called Gecko Driver, found here <a href="https://github.com/mozilla/geckodriver" rel="nofollow">https://github.com/mozilla/geckodriver</a>. Other people have had success going back to a previous version (before 48) of Firefox as well. I'm also experiencing this problem and don't actually understand how to do either solution and am making slow progress.</p>

<p>Hi Dennis, I'll post my step by step solution now that I got it to work.</p>

<h1>Step By Step solution</h1>

<p>The problem is that Selenium and Firefox don't support one another anymore. I don't actually understand why but hopefully someone can comment and explain in more thorough detail than I. There are two possible solutions. One is install something called Geckodriver. I got that installed but had difficulty adding it to my PATH and generally found myself frustrated. </p>

<p><strong>Instead</strong> I went a simpler route. 
First I uninstalled firefox with the command</p>

<pre><code>sudo apt-get purge firefox
</code></pre>

<p>Then I downloaded <a href="https://ftp.mozilla.org/pub/firefox/releases/47.0.1/" rel="nofollow">Firefox 47.0.1</a> from here (I selected the english US version). I then moved it from my downloads folder to my home folder. Then I extracted it using this command.</p>

<pre><code>tar xjf firefox-47.0.1.tar.bz2
</code></pre>

<p>Your number Firefox may be different from mine. Then I cd'd into that directory</p>

<pre><code>cd firefox    
</code></pre>

<p>which brought me into that directory. Then all that was left was to run the command </p>

<pre><code>sudo apt install firefox 
</code></pre>

<p>After which the version of Selenium I have worked again. Happily I'm back to writing code not configuring things!</p>

python python-3.x selenium firefox