selenium-wire
selenium-wire copied to clipboard
Selenium Wire Remote instantiates with incorrect arguments
When instantiating a selenium-wire remote webdriver, it passes to the original selenium remote webdriver a desired_capabilities arguments which is not accepted. If changed to options in the init method
`class Remote(InspectRequestsMixin, DriverCommonMixin, _Remote): """Extend the Remote webdriver to provide additional methods for inspecting requests."""
def __init__(self, *args, seleniumwire_options=None, **kwargs):
"""Initialise a new Firefox WebDriver instance.
Args:
seleniumwire_options: The seleniumwire options dictionary.
"""
if seleniumwire_options is None:
seleniumwire_options = {}
config = self._setup_backend(seleniumwire_options)
if seleniumwire_options.get('auto_config', True):
capabilities = kwargs.get('desired_capabilities')
if capabilities is None:
capabilities = DesiredCapabilities.FIREFOX.copy()
else:
capabilities = capabilities.copy()
capabilities.update(config)
kwargs['desired_capabilities'] = capabilities
pdb.set_trace()
super().__init__(*args, **kwargs)`
"desired_capabilities" is not a valid argument to pass, I tried changing it to "options" which is a valid argument, but then chrome crashes. Any help would be amazing on this.
I've run into the same issue. I downgraded my selenium version from 4.14.0 to 4.4.0 and was able to init a remote browser
本地修改对应的代码 注释kwargs['desired_capabilities'] = capabilities