Selenium chrome driver httplib.badstatusline

I install selenium, chrome, pyvritualdisplay and xvfb using the following tutorial: https://christopher.su/2015/selenium-chromedriver-ubuntu/

when i try to run selenium python script i get this error when i call webdriver.Chrome ()

I am using python2.7.6 on Ubuntu 14.04.3 LTS

Traceback (most recent call last): File "selenium_python_unittests/attempt_50.py", line 9, in <module> driver = webdriver.Chrome() File "/home/sele/headless/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__ desired_capabilities=desired_capabilities) File "/home/sele/headless/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__ self.start_session(desired_capabilities, browser_profile) File "/home/sele/headless/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session response = self.execute(Command.NEW_SESSION, capabilities) File "/home/sele/headless/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 234, in execute response = self.command_executor.execute(driver_command, params) File "/home/sele/headless/local/lib/python2.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 407, in execute return self._request(command_info[0], url, body=data) File "/home/sele/headless/local/lib/python2.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 439, in _request resp = self._conn.getresponse() File "/usr/lib/python2.7/httplib.py", line 1051, in getresponse response.begin() File "/usr/lib/python2.7/httplib.py", line 415, in begin version, status, reason = self._read_status() File "/usr/lib/python2.7/httplib.py", line 379, in _read_status raise BadStatusLine(line) httplib.BadStatusLine: '' 

Any idea? This makes no sense to me because this exception occurs before I even make a web request to the website

 driver.get('http://christopher.su') 
+6
source share
2 answers

Used an outdated version of the chrome driver.

If you have this problem, check if you are using the latest chrome rib update and Chrome browser. and make sure you use python2 +

Thanks.

+8
source

Updating the new version of Chromedriver (2.26) fixed this for me.

+1
source

Source: https://habr.com/ru/post/1011779/


All Articles