Skip to content

Instantly share code, notes, and snippets.

@jlegido
Forked from cgoldberg/geckodriver-install.sh
Last active May 8, 2020 06:22
Show Gist options
  • Select an option

  • Save jlegido/7dbace98bb899180e5801002f5204dee to your computer and use it in GitHub Desktop.

Select an option

Save jlegido/7dbace98bb899180e5801002f5204dee to your computer and use it in GitHub Desktop.
download and install latest geckodriver for linux or mac (selenium webdriver)
#!/bin/sh
# install latest geckodriver for Linux
install_dir='/usr/local/bin'
url=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | \
jq -r '.assets[].browser_download_url | select(contains("linux64"))')
tarball="geckodriver.tar.gz"
curl -L -s -o "$tarball" "$url"
tar -xzf "$tarball"
rm "$tarball"
chmod +x geckodriver
sudo mv geckodriver "$install_dir"
echo "installed geckodriver in $install_dir"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment