Search code examples
pythonseleniumselenium-webdriverubuntu-14.04httplib

Error setting up Selenium on Ubuntu server 14.04, httplib.BadStatusLine: ''


I am trying to set up Selenium to run on my Ubuntu server and followed the exact steps found here. Now trying the sample script provided:

from pyvirtualdisplay import Display
from selenium import webdriver

display = Display(visible=0, size=(800, 600))
display.start()
driver = webdriver.Chrome()
driver.get('http://christopher.su')
print driver.title

Only results in httplib.BadStatusLine: ''.

I am on Ubuntu 14.04, x86_64. Just update python using conda and Selenium version 3.0.1.


Solution

  • Uninstall chromedriver and reinstall with the latest stable from here, https://sites.google.com/a/chromium.org/chromedriver/downloads.

    In terminal, do the following:

    wget https://chromedriver.storage.googleapis.com/2.25/chromedriver_linux64.zip sudo unzip chromedriver_linux64.zip -d /usr/local/bin sudo chmod 755 /usr/local/bin/chromedriver

    Check your version (chromedriver --version) mine says 2.25 and your Chrome browser version (should be 54*).

    I was getting all your same errors trying to install chromedriver 2.9, and I decided to uninstall all of it, then reinstall and that worked.