Open BarryBahrami opened 1 month ago
I'll have to look into how to use Selenium WebDriver with Snap Firefox rather than a system package, but what error are you getting exactly?
Looking into this via a virtual machine, the problem seems to tie back to Snap. It is a real known limitation of Geckodriver, but the sandbox workarounds listed here did not work for me. As a test, I used independent Firefox and Geckodriver executables in Selenium (not RumChat Actor) via the following code...
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.service import Service
fpath = "/home/wilbur/Downloads/firefox-129.0.1/firefox/firefox"
gpath = "/home/wilbur/Downloads/geckodriver"
driver_service = Service(executable_path = gpath)
options = Options()
options.binary_location = fpath
driver = webdriver.Firefox(options = options, service = driver_service)
...and the driver does open successfully. Since Firefox has an official ppa available, I recommend you use the first workaround they mention: A non-sandboxed Firefox install. To do this, migrate your Firefox profile with mkdir -p ~/.mozilla/firefox/ && cp -a ~/snap/firefox/common/.mozilla/firefox/* ~/.mozilla/firefox/
(or sync with a Mozilla account), uninstall the Firefox Snap edition with snap remove firefox
, and install the non-Snap version per Mozilla's instructions. I have confirmed that this will make Selenium WebDriver work normally. If you can figure out how to make Snap Firefox work properly, possibly in the future when the included Snap Geckodriver is up to date, let me know.
Your firefox install workaround worked for me - thank you.
Ideally I need to run this headless. Do you think that will ever be an option?
I ended up having to fix a couple things mostly with f-strings for the library to run, for me at least. I can email these to you if you like or tell me if/how you want them. thank you
Ideally I need to run this headless. Do you think that will ever be an option?
See #20
I ended up having to fix a couple things mostly with f-strings for the library to run, for me at least. I can email these to you if you like or tell me if/how you want them. thank you
I just made an update that fixes a few problems, but if you update and they are still there, the standard way is to:
Nice library. I'm having difficulty getting it to run though. can you give me some info about the basic setup?
I have ubuntu 24.04 and it wants to install firefox with snap. I'm not sure your library is seeing it. little lost.
thank you