MaxRetryError with selenium

Viewed 44

I have two threads that execute the same function: at the start, they initialize the driver, iterate over a list (getting a new page for each element), and then call quit(); everything is wrapped in a try-finally block. The function is wrapped in a while True for being executed forever. My issue is that after while selenium gives me this error:

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f62f81945b0>: Failed to establish a new connection: [Errno 111] Connection refused')': /session
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f62f8194dc0>: Failed to establish a new connection: [Errno 111] Connection refused')': /session
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f62f8194430>: Failed to establish a new connection: [Errno 111] Connection refused')': /session
<class 'urllib3.exceptions.MaxRetryError'>
HTTPConnectionPool(host='localhost', port=35098): Max retries exceeded with url: /session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f62f81943a0>: Failed to establish a new connection: [Errno 111] Connection refused'))
0 Answers
Related