Download Geckodriver For Firefox Mac

Download Geckodriver For Firefox Mac 9,4/10 3130 votes
download and install latest geckodriver for linux or mac (selenium webdriver)
geckodriver-install.sh
#!/bin/bash
# download and install latest geckodriver for linux or mac.
# required for selenium to drive a firefox browser.
install_dir='/usr/local/bin'
json=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest)
if [[ $(uname)'Darwin' ]];then
url=$(echo '$json' jq -r '.assets[].browser_download_url select(contains('macos'))')
elif [[ $(uname)'Linux' ]];then
url=$(echo '$json' jq -r '.assets[].browser_download_url select(contains('linux64'))')
else
echo'can't determine OS'
exit 1
fi
curl -s -L '$url' tar -xz
chmod +x geckodriver
sudo mv geckodriver '$install_dir'
echo'installed geckodriver binary in $install_dir'

Aug 14, 2017  geckodriver is not yet feature complete.Support is best in Firefox 54 and greater, generally the more recent the Firefox version, the better the experience as they have more bug fixes and features. Some features will only be available in the most recent Firefox versions, and we strongly advise using the latest Firefox Nightly with geckodriver.

commented Sep 12, 2017

Thank you. ðŸ‘x8D

commented Oct 9, 2017
edited

Hi, thanks for this script! Very helpful.

I copied and used it for Chromedriver as well, here it is:

I'll create a gist with both and quote you as the source, thanks!

EDIT: Here is the gist https://gist.github.com/diemol/635f450672b5bf80420d595ca0016d20

commented Feb 2, 2018

Before I could run this script, I had to install jq.
brew install jq
macos. System version.

FYI:
read article

Geckodriver

commented Feb 11, 2018

put set -e; at the top of your bash scripts

commented Apr 18, 2018

You could also use Python:

commented Jun 23, 2018
edited

commented Jul 20, 2018
edited

Working in Ubuntu 18.04.
sudo apt install jq was necessary.

@Jambon1510 :

This is not working for me, url return is empty.

Well, you might be on a 32-bit machine. Try changing linux64 in this line :
10 : url=$(echo '$json' jq -r '.assets[].browser_download_url select(contains('linux64'))')
to linux32.

commented Jan 14, 2020

Without using jq command, you can simply grep for the file address:

(The tar checkpoint option is to print dots progress)

Top 3 alternatives to pikachu volleyball for mac 2017

commented Jan 15, 2020

Hi, thanks for this script! Very helpful.

I copied and used it for Chromedriver as well

For chrome driver, it is a ZIP not GZ archive, so you can use JAR command to extract:
curl -L $chromedriver_zip_url jar xv

commented Mar 6, 2020

Thanks for sharing!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment