Chrome failed to start on CentOS using chromedriver2.9 Chrome failed to start on CentOS using chromedriver2.9 selenium selenium

Chrome failed to start on CentOS using chromedriver2.9


Are you using headless? If so, you will have to specify the headless display through pyvirtualdisplay.

I had the same error (log) when I was running selenium headless without telling selenium to use visual display. After installing pyvirtualdisplay, the following code works for me:

from selenium import webdriverfrom pyvirtualdisplay import Displaydisplay = Display(visible=0, size=(800, 600))display.start()driver = webdriver.Chrome()driver.get("http://www.google.com")print driver.page_source.encode('utf-8')driver.quit()display.stop()