How do I use the chrome driver in Ubuntu 16.04?

Solution 1:

You can use chromium-chromedriver:

sudo apt-get install chromium-chromedriver

Or download proprietary ChromeDriver and use it:

wget https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
./chromedriver

You need to install selenium python packages:

sudo apt-get install python-selenium python3-selenium

It works with Google's Getting started python program:

import time
from selenium import webdriver

driver = webdriver.Chrome('./chromedriver')  # Optional argument, if not specified will search path.
# or '/usr/lib/chromium-browser/chromedriver' if you use chromium-chromedriver
driver.get('http://www.google.com/xhtml');
time.sleep(5) # 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) # Let the user actually see something!
driver.quit()