Selenium Issues

I am attempting to run selenium from python

Code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By


options = webdriver.ChromeOptions()
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--headless=new")
driver = webdriver.Chrome(options=options)
driver.get("...")

This returns an error:
Code:
    driver = webdriver.Chrome(options=options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 .venv/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 82, in __init__
    service.path = DriverFinder.get_path(service, options)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py", line 43, in get_path
    raise err
.venv/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py", line 40, in get_path
    path = shutil.which(service.path) or SeleniumManager().driver_location(options)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 77, in driver_location
    args = [str(self.get_binary()), "--browser", browser, "--output", "json"]
                ^^^^^^^^^^^^^^^^^
.venv/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 61, in get_binary
    raise SeleniumManagerException(f"{path} is missing.  Please open an issue on {tracker}")
selenium.common.exceptions.SeleniumManagerException: Message: ./venv/lib/python3.11/site-packages/selenium/webdriver/common/freebsd15/selenium-manager is missing.  Please open an issue on https://github.com/SeleniumHQ/selenium/issues

I assumed at first that selenium was not being found on the system, so built the port www/selenium and then www/py-selenium (config without chromium or firefox; I think I built chromium as a dep to get qutebrowser) but I am still getting this error.

I assume somehow telling the python script where the chromedriver/selenium binary is would work, but I do not know where that would be, how to install it, or whatever else would be needed to get this working.

It seems like the FreeBSD selenium situation has boiled down to 'bsd can just run the linux binary' in this github issue: Selenium on FreeBSD

What can be done, if anything, if I want pure BSD selenium chromedriver? I plan to toy around with linux compatability later on, not yet, so I woul prefer to not just use the linux binary.

If the selenium manager program were active, would it err on something? Does anyone have familiarity with working with selenium of FreeBSD 15 latest built with ports?
 
I see in this FreeBSD forum post on selenium that setting geckodriver directly based on path should work

Code:
driver = webdriver.Firefox(service=Service(executable_path="./geckodriver"), options = options)

So what might the steps be for chromium in place of Firefox/geckodriver?
 
Back
Top