我最近升级到16.04。
我安装了selenium == 3.0.2,现在当我运行脚本时,这就是我所看到的:
Traceback (most recent call last):
File "aux.py", line 3, in <module>
browser = webdriver.Chrome()
File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
desired_capabilities=desired_capabilities)
File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/remote/webdriver.py", line 234, in execute
response = self.command_executor.execute(driver_command, params)
File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/remote/remote_connection.py", line 408, in execute
return self._request(command_info[0], url, body=data)
File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/remote/remote_connection.py", line 440, in _request
resp = self._conn.getresponse()
File "/usr/local/lib/python3.4/http/client.py", line 1227, in getresponse
response.begin()
File "/usr/local/lib/python3.4/http/client.py", line 386, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.4/http/client.py", line 356, in _read_status
raise BadStatusLine(line)
http.client.BadStatusLine: ''
这就是脚本中的全部内容:
from selenium import webdriver
# from selenium.webdriver.common.keys import Keys
browser = webdriver.Chrome()
browser.get('google.com')