Python selenium firefox browser launch error
<p>I am trying to launch Firefox (48.0.2) using Selenium with Python 3.5 on my mac using the following code:</p>

<pre><code>from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://bbc.co.uk')
</code></pre>

<p>However, Firefox launches without going to the specified webpage and times out with the following error message:</p>

<pre><code>Traceback (most recent call last):
  File "/Users/anthonyperera/Documents/Python/AutomatePython/seleniumexample.py", line 2, in &lt;module&gt;
    browser = webdriver.Firefox()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 80, in __init__
    self.binary, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__
    self.binary.launch_browser(self.profile, timeout=timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
    self._wait_until_connectable(timeout=timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-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: /var/folders/6n/_xgjldp12r59c6gdvgb46nsm0000gn/T/tmpwlxtjbt4 If you specified a log_file in the FirefoxBinary constructor, check it for details.
</code></pre>

<p>I had the same issue and I solved it. Firefox 48+ doesn't support <code>webdriver.Firefox()</code>.   </p>

<p>My environment:<br>
MacOS 10.11.6, python 3.5.2, firefox 48.0.2, Django 1.10, selenium 2.53.6    </p>

<pre><code>from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

caps = DesiredCapabilities.FIREFOX
caps["marionette"] = True
caps["binary"] = "/Applications/Firefox.app/Contents/MacOS/firefox-bin"

browser = webdriver.Firefox(capabilities=caps)
browser.get('http://bbc.co.uk')
</code></pre>

<p>This is what I was trying<br>
1. download <code>geckodriver</code>.<a href="https://github.com/mozilla/geckodriver/releases" rel="nofollow">https://github.com/mozilla/geckodriver/releases</a>. <code>v.0.10.0</code>is for <code>selenium 3(beta)</code>. if you use <code>selenium 2.xx</code>, download <code>v.0.9.0</code><br>
2. open <code>~/.bash_profile</code>. you can edit it by <code>$ vim ~/.bash_profile</code>.<br>
3. add PATH like..<br>
<code>export PATH=$PATH:/path/to/your/.../geckodriver-v0.9.0-mac</code><br>
4. <code>geckodriver</code> under the folder <code>geckodriver-v0.9.0-mac</code>, rename it to  <code>wires</code><br>
5. restart shell<br>
6. check the version<br>
<code>$ wires --version</code><br>
7. and run above the code!   </p>

<ul>
<li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver" rel="nofollow">webdriver-mozilla</a></li>
</ul>

python selenium firefox