|# download and install latest geckodriver for linux or mac.|
|# required for selenium to drive a firefox browser.|
|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"))')|
|echo "can't determine OS"|
|curl -s -L "$url" | tar -xz|
|chmod +x geckodriver|
|sudo mv geckodriver "$install_dir"|
|echo "installed geckodriver binary in $install_dir"|
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
You could also use Python:
This is not working for me, url return is empty
Working in Ubuntu 18.04.
Well, you might be on a 32-bit machine. Try changing