Scrape web with selenium and chromedriver with python, on Ubuntu 17.10

First download chromedriver:

Eg: Downloading latest version ChromeDriver 2.37:

cd ~/Downloads
wget https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
sudo cp ~/Downloads/chromedriver /usr/local/share/
sudo chmod +x /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver

Now install selenium:

pip install selenium

Python test script:

from selenium import webdriver
import os
chromedriver = "/usr/bin/chromedriver"
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome(chromedriver)
my_url = 'https://www.pastest.com/'
driver.get(my_url)
driver.quit()