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
# download and install geckodriver for selenium
url=$(curl -s "https://api.github.com/repos/mozilla/geckodriver/releases/latest" \
| python -c "import sys, json; r = json.load(sys.stdin); print [a for a in r['assets'] if 'linux64' in a['name']][0]['browser_download_url'];")
curl -L -o geckodriver.tar.gz $url
tar -xzf geckodriver.tar.gz
chmod +x geckodriver
sudo mv geckodriver /usr/local/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment