selenium.webdriver.edge.options#

Classes

Options()

Initialize EdgeOptions with default settings.

class Options[source]#

Bases: ChromiumOptions

Initialize EdgeOptions with default settings.

KEY = 'ms:edgeOptions'#
property use_webview: bool#

Returns Whether WebView2 is enabled for Edge browser.

to_capabilities()[source]#

Creates a capabilities with all the options that have been set.

Returns:

A dictionary with all set options for Edge browser.

Return type:

dict

BINARY_LOCATION_ERROR = 'Binary Location Must be a String'#
FEDCM_CAPABILITY = 'fedcm:accounts'#
add_argument(argument)#

Adds an argument to the list.

Parameters:

argument (str) – Sets the arguments

Return type:

None

add_encoded_extension(extension)#

Add Base64-encoded string with extension data to be extracted to ChromeDriver.

Parameters:

extension (str) – Base64 encoded string with extension data.

Return type:

None

add_experimental_option(name, value)#

Adds an experimental option which is passed to chromium.

Parameters:
  • name (str) – The experimental option name.

  • value (str | int | dict | list[str]) – The option value.

Return type:

None

add_extension(extension)#

Add the path to an extension to be extracted to ChromeDriver.

Parameters:

extension (str) – Path to the *.crx file.

Return type:

None

property arguments#

Returns a list of arguments needed for the browser.

property binary_location: str#

Returns the location of the binary, otherwise an empty string.

property capabilities#
property debugger_address: str | None#

Returns the address of the remote devtools instance.

property default_capabilities: dict#

Returns the default capabilities for Edge browser.

enable_mobile(android_package=None, android_activity=None, device_serial=None)#

Enables mobile browser use for browsers that support it.

Parameters:
  • android_package (str | None) – The name of the android package to start

  • android_activity (str | None) – The name of the android activity

  • device_serial (str | None) – The device serial number

Return type:

None

property enable_webextensions: bool#

Return whether webextension support is enabled for Chromium-based browsers.

property experimental_options: dict#

Returns a dictionary of experimental options for chromium.

property extensions: list[str]#

Returns a list of encoded extensions that will be loaded.

ignore_local_proxy_environment_variables()#

Ignore HTTP_PROXY and HTTPS_PROXY environment variables.

This method is deprecated; use a Proxy instance with ProxyType.DIRECT instead.

Return type:

None

set_capability(name, value)#

Sets a capability.

Return type:

None

mobile_options: dict[str, str] | None#
browser_version#

Gets and Sets the version of the browser.

Usage:
  • Get: self.browser_version

  • Set: self.browser_version = value

Parameters:

value – str

Returns:

str when getting, None when setting.

platform_name#

Gets and Sets name of the platform.

Usage:
  • Get: self.platform_name

  • Set: self.platform_name = value

Parameters:

value – str

Returns:

str when getting, None when setting.

accept_insecure_certs#

Gets and Set whether the session accepts insecure certificates.

Usage:
  • Get: self.accept_insecure_certs

  • Set: self.accept_insecure_certs = value

Parameters:

value – bool

Returns:

bool when getting, None when setting.

strict_file_interactability#

Gets and Sets whether session is about file interactability.

Usage:
  • Get: self.strict_file_interactability

  • Set: self.strict_file_interactability = value

Parameters:

value – bool

Returns:

bool when getting, None when setting.

set_window_rect#

Gets and Sets window size and position.

Usage:
  • Get: self.set_window_rect

  • Set: self.set_window_rect = value

Parameters:

value – bool

Returns:

bool when getting, None when setting.

enable_bidi#

Gets and Set whether the session has WebDriverBiDi enabled.

Usage:
  • Get: self.enable_bidi

  • Set: self.enable_bidi = value

Parameters:

value – bool

Returns:

bool when getting, None when setting.

page_load_strategy#

Gets and Sets page load strategy, the default is “normal”.

Usage:
  • Get: self.page_load_strategy

  • Set: self.page_load_strategy = value

Parameters:

value – str

Returns:

str when getting, None when setting.

unhandled_prompt_behavior#

Gets and Sets unhandled prompt behavior, the default is “dismiss and notify”.

Usage:
  • Get: self.unhandled_prompt_behavior

  • Set: self.unhandled_prompt_behavior = value

Parameters:

value – str

Returns:

str when getting, None when setting.

timeouts#

Gets and Sets implicit timeout, pageLoad timeout and script timeout if set (in milliseconds).

Usage:
  • Get: self.timeouts

  • Set: self.timeouts = value

Parameters:

value – dict

Returns:

dict when getting, None when setting.

proxy#

Sets and Gets Proxy.

Usage:
  • Get: self.proxy

  • Set: self.proxy = value

Parameters:

value – Proxy

Returns:

Proxy when getting, None when setting.

enable_downloads#

Gets and Sets whether session can download files.

Usage:
  • Get: self.enable_downloads

  • Set: self.enable_downloads = value

Parameters:

value – bool

Returns:

bool when getting, None when setting.

web_socket_url#

Gets and Sets WebSocket URL.

Usage:
  • Get: self.web_socket_url

  • Set: self.web_socket_url = value

Parameters:

value – str

Returns:

str when getting, None when setting.