aboutsummaryrefslogtreecommitdiff
path: root/0003_download_chromedriver.sh
diff options
context:
space:
mode:
authorGus Power <gus@infinitesidequests.com>2025-05-26 11:41:29 +0100
committerGus Power <gus@infinitesidequests.com>2025-05-26 11:41:29 +0100
commit9a78f4ad088d18f19506c2023a60ab89b7736b3e (patch)
tree7d1ae94338285e37b53f87cc681be5aaeda9577d /0003_download_chromedriver.sh
parent60e78e2057e2197bb2b13d162c7cab26b0374dcb (diff)
added chromedriver download scriptHEADmain
Diffstat (limited to '0003_download_chromedriver.sh')
-rwxr-xr-x0003_download_chromedriver.sh22
1 files changed, 22 insertions, 0 deletions
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
+