I can't figure out how to connect to an existing Firefox marionette session using Selenium Wire.I can connect to an existing marionette session using Selenium:
from selenium import webdriverfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.firefox.options import Options as FirefoxOptionsoptions = FirefoxOptions()service = webdriver.FirefoxService(service_args = ['--marionette-port', '2828', '--connect-existing'] )driver = webdriver.Firefox(options= options,service=service)
But when I use the same FirefoxOptions in Selenium Wire, it opens a new Firefox session without connecting to the existing Marionette session:
seleniumwire_options = {'service_args': {'--marionette-port', '2828', '--connect-existing'},}driver = seleniumwire_webdriver.Firefox( options=fireFoxOptions, seleniumwire_options=seleniumwire_options )
When I try to "combine" them using this:
service = seleniumwire_webdriver.FirefoxService(service_args = ['--marionette-port', '2828', '--connect-existing'] )driver = seleniumwire_webdriver.Firefox(options= options,service=service)
I get an error:
module 'seleniumwire.webdriver' has no attribute 'FirefoxService'
My question: How do I use Selenium Wire to connect to an existing Firefox Marionette session, so that it doesn't open a new browser session?