Skip to content

Instantly share code, notes, and snippets.

@xanderim
Last active December 18, 2019 19:08
Show Gist options
  • Save xanderim/335f8c0926bf64b8cee552b0ad9dd560 to your computer and use it in GitHub Desktop.
Save xanderim/335f8c0926bf64b8cee552b0ad9dd560 to your computer and use it in GitHub Desktop.
Install Chromium, chromedriver and Selenium (Python) on Ubuntu
Source https://stackoverflow.com/a/53590694 + minor updates

# install chromium, its driver, and selenium
apt-get update
apt install chromium-chromedriver
pip install selenium
# set options to be headless, ..
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
# in case you have chrome and chromium installed you should specify briwser binary path
options.binary_location = '/usr/bin/chromium-browser'
# open it, go to a website, and get results
wd = webdriver.Chrome('chromedriver', chrome_options=options)
wd.get("https://www.website.com")
print(wd.page_source) # results-get update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment