Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98265

How to install and use the latest version of selenium with Firefox on Ubuntu 22.04LTS?

$
0
0

I want to automate the login process to the pfsense captive portal, to do this I use Ubuntu 22.04LTS arm64. To be able to connect to this portal I have to enter my username, and password, accept the cgu, and then press accept. So to automate this I've seen that I can use Selenium with Firefox, I've done the steps of the Selenium website to install it for Python and for the geckodriver, but after I wrote my code and wanted to run it, an error appeared.

The code is:

from selenium import webdriverdriver = webdriver.Firefox()
The error is:Traceback (most recent call last):  File "/home/flo/.local/lib/python3.10/site-packages/selenium/webdriver/common/selenium_manager.py", line 134, in run    completed_proc = subprocess.run(args, capture_output=True)  File "/usr/lib/python3.10/subprocess.py", line 503, in run    with Popen(*popenargs, **kwargs) as process:  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__    self._execute_child(args, executable, preexec_fn, close_fds,  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child    raise child_exception_type(errno_num, err_msg, err_filename)OSError: [Errno 8] Exec format error: '/home/flo/.local/lib/python3.10/site-packages/selenium/webdriver/common/linux/selenium-manager'The above exception was the direct cause of the following exception:Traceback (most recent call last):  File "/home/flo/.local/lib/python3.10/site-packages/selenium/webdriver/common/driver_finder.py", line 38, in get_path    path = SeleniumManager().driver_location(options) if path is None else path  File "/home/flo/.local/lib/python3.10/site-packages/selenium/webdriver/common/selenium_manager.py", line 103, in driver_location    output = self.run(args)  File "/home/flo/.local/lib/python3.10/site-packages/selenium/webdriver/common/selenium_manager.py", line 140, in run    raise WebDriverException(f"Unsuccessful command executed: {command}") from errselenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: /home/flo/.local/lib/python3.10/site-packages/selenium/webdriver/common/linux/selenium-manager --browser firefox --output jsonThe above exception was the direct cause of the following exception:Traceback (most recent call last):  File "/home/flo/Documents/script.py", line 3, in <module>    driver = webdriver.Firefox()  File "/home/flo/.local/lib/python3.10/site-packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__    self.service.path = DriverFinder.get_path(self.service, options)  File "/home/flo/.local/lib/python3.10/site-packages/selenium/webdriver/common/driver_finder.py", line 41, in get_path    raise NoSuchDriverException(msg) from errselenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain a driver for Firefox using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

Viewing all articles
Browse latest Browse all 98265

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>