import time
from selenium import webdriver
from xvfbwrapper import Xvfb
vdisplay = Xvfb()
vdisplay.start()
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-setuid-sandbox")
driver = webdriver.Chrome("/usr/local/sbin/chromedriver", chrome_options=chrome_options) -sharp Optional argument, if not specified will search path.
driver.get("http://www.google.com/xhtml");
time.sleep(5) -sharp Let the user actually see something!
search_box = driver.find_element_by_name("q")
search_box.send_keys("ChromeDriver")
search_box.submit()
time.sleep(5) -sharp Let the user actually see something!
driver.quit()
vdisplay.stop()