Im trying to run python script using selenium module to make basic automated youtube search.
I get the error show in the middle picture when I write the script as a whole but when I write the code line-by-line it works perfectly .
I tried reinstalling gecko and firefox but didn
t work .
how i installed gecko: 1)un-tar file 2) make file executable 3)mv file to usr/local/bin ...
Geckodriver 26.0.0
Firefox 75.0
ubuntu 19.10
vim 8.2
The log is pretty clear about the error, you cannot run geckodriver
as root
, you've to run it under a different user, which you can do using sudo -H -u
, i.e.:
chown someuser:someuser /path/to/script.py
sudo -H -u someuser python /path/to/script.py