-1

I've been trying to get selenium to work on my Raspberry Pi 4 for a while now but I'm continuously getting this error when running it normally with geckodriver 0.23.0 ( 2018-10-04 ):

selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

and another error similar to this:

RuntimeError: Could not find firefox in your system PATH. Please specify the firefox binary location or install firefox

It would tell me how it couldn't find Firefox in PATH that I was to install Firefox binary if it hadn't been installed yet. I used the following command to install what seems to be the only compatible version of Firefox for my operating system:

sudo apt-get install firefox-esr

I tried my script again, but would get this instead:

selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.

I'm guessing this is due to the fact that I'm using Raspbian OS (Lite), meaning that it runs in a terminal based environment, but this isn't very concerning because I could most likely just use a virtual environment. BUT, this is not what I want. Before upgrading my Pi, I was able to use selenium perfectly fine, the same version of selenium, but in headless mode.

Why do I have to install Firefox if I already have geckodriver and selenium all set into place?

Using Python3.9.1

1 Answers1

0

Had to preset FirefoxBinary to headless:

binary = FirefoxBinary()
binary.add_command_line_options("--headless")

Driver = Firefox(firefox_binary=binary)