Make Chromedriver executable under Debian 10 (SSH)

Make Chromedriver executable under Debian 10 (SSH)

Some of you are certainly experimenting with Python at the moment and I personally have only done this on Windows so far. To run your Python scripts that use the chromedriver via SSH on Debian 10, you have to make the chromedriver executable on Debian 10. The problem here are among other things the dependencies, so it may be that in my example also a little too many dependencies are installed (because at least I needed them).

For this purpose I have collected the corresponding commands:

sudo apt-get install unzip
wget -N http://chromedriver.storage.googleapis.com/2.26/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
chmod +x chromedriver
sudo mv -f chromedriver /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
sudo apt install python3-pip
pip3 install selenium
pip3 install undetected_chromedriver
pip3 install lxml
apt install libnss3-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxss-dev
sudo apt install libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm-dev libnss3-dev libxss-dev
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb

The script can then be executed with python3 in front of it, e.g.:

python3 script.py

In order to execute the future script by cronjob every day at 5 o’clock in the morning, the following command can be used

crontab -e

to add a new cronjob.

In my example, this would be:

0 5 * * * /usr/bin/python3 /root/spy.py > /dev/null 2>&1

Leave a Reply

Your email address will not be published. Required fields are marked *