Skip to content

Instantly share code, notes, and snippets.

@mylk
Created December 13, 2020 17:15
Show Gist options
  • Save mylk/c6dffbcbbe25230307a5caf068ced8a4 to your computer and use it in GitHub Desktop.
Save mylk/c6dffbcbbe25230307a5caf068ced8a4 to your computer and use it in GitHub Desktop.
Downloads the suitable chromedriver for your Chrome browser version
#!/bin/bash
CHROME_VERSION=`google-chrome-stable --version | awk '{print($3)}' | awk -F '.' '{print($1"."$2"."$3)}'`
CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION}"`
echo "Chrome version: ${CHROME_VERSION}"
echo "Suitable chromedriver version: ${CHROMEDRIVER_VERSION}"
echo ""
echo "Downloading chromedriver..."
curl -s -o chromedriver_linux64.zip "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
echo "Downloaded!"
echo ""
echo "Unzipping..."
unzip chromedriver_linux64.zip
rm chromedriver_linux64.zip
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment