Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Selenium Wire Remote instantiates with incorrect arguments #717

Open
anthonybtedesco opened this issue Oct 7, 2023 · 2 comments
Open

Selenium Wire Remote instantiates with incorrect arguments #717

anthonybtedesco opened this issue Oct 7, 2023 · 2 comments

Comments

@anthonybtedesco
Copy link

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.

@amenzel1986
Copy link

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

@zh199609
Copy link

本地修改对应的代码
注释kwargs['desired_capabilities'] = capabilities

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants