title: Calling the Firefox webdriver in python
body: <p>I'm using <strong>Debian 9 Stretch</strong> and <strong>Pycharm IDE</strong> and trying to learn web-scramping; I installed the <em>Selenium</em> package simply by running:</p>
  
  <pre><code>pip install selenium
  </code></pre>
  
  <p>and the Firefox webdriver by running:</p>
  
  <pre><code>wget https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-linux64.tar.gz
  tar -xvzf geckodriver-v0.19.1-linux64.tar.gz.1
  
  chmod +x geckodriver
  </code></pre>
  
  <p>respectively, to download the last release, extract it and make the driver executable. After that, I added the driver to the following path: </p>
  
  <pre><code>usr/local/bin
  </code></pre>
  
  <p>I ran all by using the Pycharm IDE terminal and not the built-in Debian terminal.</p>
  
  <p>In order to open Firefox and web-scrape, I run:</p>
  
  <pre><code>import selenium
  from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  
  webdriver.Firefox(executable_path="/usr/local/bin/geckodriver")
  </code></pre>
  
  <p>The last line gives an error message as output:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;input&gt;", line 1, in &lt;module&gt;
    File "/root/PycharmProjects/Example/venv/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 162, in __init__
      keep_alive=True)
    File "/root/PycharmProjects/Example/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 154, in __init__
      self.start_session(desired_capabilities, browser_profile)
    File "/root/PycharmProjects/Example/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
      response = self.execute(Command.NEW_SESSION, parameters)
    File "/root/PycharmProjects/Example/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
      self.error_handler.check_response(response)
    File "/root/PycharmProjects/Example/venv/lib/python3.5/site-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>
  
  <p>I'm a newbie both in Python and in web-scraping; please, could someone explain what does go wrong with installation and coding and why I got this error?</p>
  
  <p>In the hope to be clear asking the question, I thanks all in advance for the help.</p>