Home > Software engineering >  How to launch Firefox browser using selenium python
How to launch Firefox browser using selenium python

Time:01-25

I am using this python selenium code: from selenium import webdriver

from selenium import webdriver

driver = webdriver.Firefox(executable_path="/home/earth/Downloads/Python/geckodriver-v0.32.0-linux-aarch64 (1)/geckodriver.exe") driver.maximize_window() driver.get("https://www.google.com/")

CodePudding user response:

I think your binary version is wrong. You are trying to launch geckodriver.exe which is probably the Windows version of the engine but it seems you are running on Linux.

Use this link to download the geckodriver-v0.32.0-linux64.tar.gz file

CodePudding user response:

from selenium import webdriver
from selenium.webdriver import FirefoxOptions

opts = FirefoxOptions()
opts.add_argument("--headless")
browser = webdriver.Firefox(options=opts)

try using selenium ~=4.4.0, to remove the executable dependency

  • Related