简体   繁体   中英

Using Selenium with headless mode on Debian server

I am trying to run a python script using selenium in headless mode.

However, I get this error:

"selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process"

The same code works well on a normal linux version (not a server one)

I found the solution.

The problem was due to the wrong installation of firefox on my debian server.

After adding the good repository deb http://ftp.fr.debian.org/debian sid main I was able to install firefox-esr and its dependencies via a simple apt install command.

Once all was installed, the python script worked as expected !

The new problem for me is now to configure www-data user permissions in order to allow it to execute the python script which needs write and execute permissions. (Currently encountering

IOError: [Errno 13] Permission denied: 'geckodriver.log'

)

I am looking for a descent solution: allowing its execution as root without password seems too dangerous in terms of security for me..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM