Q:

Python selenium ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

I am using python 3.6 and using the latest version of chromedriver, I have tried using older version of chromedriver and I get the same problem restarted my pc, same problem. this is the code I run to reproduce the error:
from selenium import webdriver

driver = webdriver.Chrome()

driver.get("https://google.com")

full error:
    driver.get("https://google.com")
  File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 268, in get
    self.execute(Command.GET, {'url': url})
  File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 254, in execute
    response = self.command_executor.execute(driver_command, params)
  File "C:\Python36\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 464, in execute
    return self._request(command_info[0], url, body=data)
  File "C:\Python36\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 488, in _request
    resp = self._conn.getresponse()
  File "C:\Python36\lib\http\client.py", line 1331, in getresponse
    response.begin()
  File "C:\Python36\lib\http\client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "C:\Python36\lib\http\client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Python36\lib\socket.py", line 586, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

A:

Put in a time.sleep(3) before driver.get("https://google.com"), that will fix your error. Then if you're like me you'll get a different error.

