Skip to content

Instantly share code, notes, and snippets.

@cgoldberg
Last active March 7, 2020 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgoldberg/94ea563a5f1826fabf838583b4832559 to your computer and use it in GitHub Desktop.
Save cgoldberg/94ea563a5f1826fabf838583b4832559 to your computer and use it in GitHub Desktop.
Download latest Selenium Standalone Server (shell script)
#!/usr/bin/env bash
# Corey Goldberg 2018
#
# download latest release of Selenium Standalone Server
#
# requires:
# * `curl`
# * `xpath` utility from the `XML::XPath` Perl module. On Debian,
# this is provided by the `libxml-xpath-perl` package.
download-selenium-server () {
local baseurl="https://selenium-release.storage.googleapis.com"
local latest=$(curl -sS "$baseurl" | xpath -q -e "./ListBucketResult/Contents/Key/text()" |
grep "selenium-server-standalone" | sort -V | tail -n 1)
local url="${baseurl}/${latest}"
local filename=$(basename "$url")
echo "Downloading: ${filename}"
curl -O# "$url"
chmod +x "$filename"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment