0

I have just begun work on selenium. But I've been encountering this problem

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 248, in get
    self.execute(Command.GET, {'url': url})
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 234, in execute
    response = self.command_executor.execute(driver_command, params)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/remote_connection.py", line 401, in execute
    return self._request(command_info[0], url, body=data)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/remote_connection.py", line 431, in _request
    self._conn.request(method, parsed_url.path, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1106, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/usr/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/usr/lib/python3.5/http/client.py", line 849, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib/python3.5/socket.py", line 711, in create_connection
    raise err
  File "/usr/lib/python3.5/socket.py", line 702, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

I did try searching on the web. My versions of selenium and Firefox are latest. Since it was just the beginning i had a simple three lines from the internet, and was trying to run that.

>>> from selenium import webdriver
>>> br = webdriver.Firefox()
>>> br.implicitly_wait(15) 
>>> br.get('http://youtube.com')
  • have you tried setting up a Firefox profile first? – Yu Zhang Jun 17 '16 at 23:53
  • Possible duplicate of [Can't open browser with selenium after firefox update](http://stackoverflow.com/questions/37761668/cant-open-browser-with-selenium-after-firefox-update) – Mobrockers Jun 18 '16 at 11:17

1 Answers1

0

Make sure you have latest version of firefox browser & geckodriver.

To install latest gecko follow the steps below:

  1. Find the latest version of the driver : wget https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-arm7hf.tar.gz

  2. Extract the file with tar -xvzf geckodriver*

  3. Make it executable : chmod +x geckodriver

  4. Add the driver to your PATH so other tools can find it: export PATH=$PATH:/path-to-extracted-file/geckodriver

Sᴀᴍ Onᴇᴌᴀ
  • 8,218
  • 8
  • 36
  • 58
jaibalaji
  • 3,159
  • 2
  • 15
  • 28