title: selenium.common.exceptions.WebDriverException: Message: connection refused while launching Firefox browser through Selenium and Python
body: <p>I am trying this code:</p>
  
  <pre><code>from selenium import webdriver
  
  browser = webdriver.Firefox()
  browser.get('http://seleniumhq.org/')
  </code></pre>
  
  <p>It opens firefox but does not get the link and shows this message:</p>
  
  <pre><code>Traceback (most recent call last):
    File "new.py", line 3, in &lt;module&gt;
      browser = webdriver.Firefox()
    File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 170, in __init__
      keep_alive=True)
    File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 156, in __init__
      self.start_session(capabilities, browser_profile)
    File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 245, in start_session
      response = self.execute(Command.NEW_SESSION, parameters)
    File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 314, in execute
      self.error_handler.check_response(response)
    File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
      raise exception_class(message, screen, stacktrace)
  selenium.common.exceptions.WebDriverException: Message: connection refused
  </code></pre>
  
  <h2>Configuration:</h2>
  
  <ul>
  <li>selenium latest version</li>
  <li>browser latest version </li>
  <li>python 2.7.14</li>
  <li>os:kali linux 2.0</li>
  </ul>
  
  <p>geckodriver log:</p>
  
  <pre><code>1527001787163   geckodriver INFO    geckodriver 0.20.1
  1527001787169   geckodriver INFO    Listening on 127.0.0.1:51383
  1527001788204   mozrunner::runner   INFO    Running command: "/usr/bin/firefox" "-marionette" "-profile" "/tmp/rust_mozprofile.IKjgvyUQaThG"
  1527001790297   Marionette  INFO    Listening on port 2828
  </code></pre>
  
  <p>[<img src="https://i.stack.imgur.com/H6Akr.png" alt="problem]"></p>