Although I know my question might be similar to some others, I have a serious problem with this, i get Message: invalid argument: can't kill an exited process
in error while trying to run the code. Note that I run this on ubuntu 20 and it doesn't have display.
Here is my code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from webdriver_manager.firefox import GeckoDriverManager
from selenium.webdriver.firefox.options import Options
options = Options()
options.headless = True
driver = webdriver.Firefox(executable_path=GeckoDriverManager().install(), options=options)
Error in console
WebDriverException: Message: invalid argument: can't kill an exited process
And this is the geckodriver log file:
1603574335551 geckodriver INFO Listening on 127.0.0.1:59603
1603574336562 mozrunner::runner INFO Running command: "/usr/bin/firefox" "--marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofilenqjQeL"
Error: no DISPLAY environment variable specified
I also read about the incompatibility of versions but it seems all of them are compatible:
- Firefox: 82.0
- GeckoDriver: v0.27.0
- Selenium: 3.141.0
I appreciate any help and how may I fix it?