Estou executando o Ubuntu Xenial 16.04 em um servidor dedicado, eu queria começar a codificar em Python, então segui este tutorial: link
Eu também instalei o Selenium e o Chromedriver e escrevi este script muito simples.py:
from time import sleep
from selenium import webdriver
browser = webdriver.Chrome()
browser.get('https://www.google.com')
sleep(5)
browser.close()
Mas quando eu executo o roteiro, ele fica pendurado para sempre, forçando-me a interrompê-lo. Quando faço isso, é o que recebo:
^CTraceback (most recent call last):
File "script.py", line 4, in <module>
browser = webdriver.Chrome()
File "/home/vcluzeau/python/my_env/lib/python3.5/site-packages/selenium/webdriver/chrome/webdriver.py", line 75, in __init__
desired_capabilities=desired_capabilities)
File "/home/vcluzeau/python/my_env/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 154, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/home/vcluzeau/python/my_env/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/home/vcluzeau/python/my_env/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 310, in execute
response = self.command_executor.execute(driver_command, params)
File "/home/vcluzeau/python/my_env/lib/python3.5/site-packages/selenium/webdriver/remote/remote_connection.py", line 466, in execute
return self._request(command_info[0], url, body=data)
File "/home/vcluzeau/python/my_env/lib/python3.5/site-packages/selenium/webdriver/remote/remote_connection.py", line 490, in _request
resp = self._conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1197, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 258, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.5/socket.py", line 575, in readinto
return self._sock.recv_into(b)
KeyboardInterrupt
Vocês sabem como eu posso consertar isso?
Obrigado!