For some tests, I've set up a plain new TrueNAS 12.3 FreeBSD Jail and started it, then installed python3
, firefox
, geckodriver
and pip
using the following commands:
pkg install python3 firefox geckodriver py38-pip
pip install --upgrade pip
setenv CRYPTOGRAPHY_DONT_BUILD_RUST 1
pip install cryptography==3.4.7
pip install selenium
Afterwards, when I want to use Selenium with Firefox in my Python code, it does not work:
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.headless = True
driver = webdriver.Firefox(options=options)
it brings
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
self.service.start()
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 98, in start
self.assert_process_still_running()
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 110, in assert_process_still_running
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: Service geckodriver unexpectedly exited. Status code was: 64
Funnily, on another Jail that I've set up approximately a year ago (approximately in the mentioned way as well), it just works and does not throw the error (so different versions maybe?)!
This is the only content of geckodriver.log
:
geckodriver: error: Found argument '--websocket-port' which wasn't expected, orisn't valid in this context
USAGE:
geckodriver [FLAGS] [OPTIONS]
For more information try --help
Is there anything I could try to get it working? I've already seen this question, but it seems fairly outdated.
Firefox 95.0.2, geckodriver 0.26.0, Python 3.8.12, Selenium 4.1.0