This is an old revision of the document!
Table of Contents
Selenium
Web scraping toolkit.
Debian
Install Selenium
apt update apt full-upgrade apt install python3-selenium
Windows 10
Install Python
Install Selenium
python -m pip install --upgrade pip pip install selenium
WSL1 alias
Chromium may be installed within WSL1 but cannot operate so creating an alias to the Windows Python executable allows scripts to run from WSL1 with the Windows browser.
TCSH
alias py "/mnt/c/Users/username/AppData/Local/Programs/Python/Python313/python.exe"
Test
This test will open chrome.exe or chromium and visit a page.
#! /usr/bin/env python3 from selenium import webdriver from selenium.webdriver.chrome.options import Options #from selenium.webdriver.firefox.options import Options from time import sleep options = Options() options.add_argument("--incognito") driver = webdriver.Chrome(options=options) #options.add_argument("-private") #driver = webdriver.Firefox(options=options) driver.get("https://www.deckenmalerei.eu/") sleep(30) driver.quit()
Incognito mode was found to be a requirement on a Linux host otherwise chromium would take about 30 seconds to open the first URL.