Selenium is a popular browser automation tool, which mainly used for UI auto test.
Python Client on Linux Mint
Follow the instructions on Python API docs in the section Selenium Client & WebDriver Language Bindings on Download page of Selenium website.
First download Firefox drivers
for Linux 64bit: geckodriver-v0.20.1-linux64.tar.gz.
Extract geckodriver and put it in a folder in $PATH, for example ~/.local/bin.
Make sure the firefox
executable is in the $PATH, and the terminal is attached
with a DISPLAY
.
If not, start ipython
with valid PATH
and DISPLAY
, for example:
PATH="$PATH:$HOME/apps/firefox" DISPLAY=:10.0 ipython
.
Here DISPLAY
is a session with X session.
On Windows the simplest way is ssh to the server with MobaXterm. Search
MobaXterm in dsnote Writing Documents with LaTeX on Ubuntu Server for details.
Then install selenium Python client and run a demo:
conda create -n browsertest python=3.5
conda install -n browsertest -c conda-forge selenium
conda install -n browsertest ipython
. activate browsertest
ipython
>>> from selenium import webdriver
>>> browser = webdriver.Firefox()
>>> browser.get('http://baidu.com')
>>> browser.quit()