From 9a78f4ad088d18f19506c2023a60ab89b7736b3e Mon Sep 17 00:00:00 2001 From: Gus Power Date: Mon, 26 May 2025 11:41:29 +0100 Subject: added chromedriver download script --- 0003_download_chromedriver.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 0003_download_chromedriver.sh (limited to '0003_download_chromedriver.sh') diff --git a/0003_download_chromedriver.sh b/0003_download_chromedriver.sh new file mode 100755 index 0000000..de8cae2 --- /dev/null +++ b/0003_download_chromedriver.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +## Simple Gentoo-compatible script to download the latest chromedriver binary + +set -euo pipefail + +chrome_version="${CHROME_VERSION:-$(equery list -F '$version' google-chrome)}" +platform="linux64" # no other linux variants seem to be published +tmpdir="${TMPDIR:-/tmp}" +chrome_version_list="${tmpdir}/chrome-versions.json" +download_location="${tmpdir}/chrome-${chrome_version}.zip" + +wget -O $chrome_version_list https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json +download_url=$(cat $chrome_version_list | jq -r '.versions[] | select(.version == "'"$chrome_version"'").downloads.chromedriver[] | select(.platform == "'"$platform"'").url') + +wget -O $download_location $download_url + +echo "Unzip the [chromedriver] from [$download_location] and place in your path:" +echo "> unzip -j $download_location chromedriver-linux64/chromedriver" +echo "Verify by running it: [> chromedriver --port=9515]" +unzip -l $download_location + -- cgit v1.2.3