Files
DatBrowser/undetectedChromedriver/getChromeDriver.sh
Matthias Guillitte 2a7330bd08
All checks were successful
Test, build and push image to registry / phpunit-tests (push) Successful in 1m54s
Test, build and push image to registry / build-image (push) Successful in 3m0s
Moved from a custom selenium UC standalone to selenium hub with a custom UC node
2025-12-16 12:47:24 +01:00

33 lines
1.2 KiB
Bash

#!/bin/bash
# version variable
# Can be found here : https://hub.docker.com/r/selenium/standalone-chrome/tags
# Will need to change it in seleniumChromedriverDockerfile and probably download
# it and change it in patchChromedriver.py
VERSION="latest"
# From undetected chromedriver docker
#sudo docker run --rm -it -p 3389:3389 -v ./undetectedChromedriver:/root/.local/share/undetected_chromedriver/ ultrafunk/undetected-chromedriver:latest
sudo docker pull selenium/node-chrome:$VERSION
# With undetected chromedriver patcher
# Run the selenium/standalone-chrome:latest with a specific container name in the background
#sudo docker run -d --name standalone-chrome -v /home/ninluc/Documents/codage/DatBrowser/undetectedChromedriver/chrome/:/opt/google/chrome/ selenium/standalone-chrome:$VERSION
sudo docker run -d --name node-chrome selenium/node-chrome:$VERSION
sleep 7
# Copy the chromedriver binary from the container to the host
sudo docker cp -L node-chrome:/bin/chromedriver ./chromedriver
sudo chmod 777 ./chromedriver
# Patch the chromedriver binary
source venv/bin/activate
python3 ./patchChromedriver.py
# Stop the container
sudo docker stop node-chrome
sudo docker rm node-chrome