selenium.webdriver.common.options¶
Classes
Base class for individual browser options. |
|
|
Enum of possible page load strategies. |
- class selenium.webdriver.common.options.PageLoadStrategy(value)[source]¶
Enum of possible page load strategies.
- Selenium support following strategies:
normal (default) - waits for all resources to download
eager - DOM access is ready, but other resources like images may still be loading
none - does not block WebDriver at all
Docs: https://www.selenium.dev/documentation/webdriver/drivers/options/#pageloadstrategy.
- normal = 'normal'¶
- eager = 'eager'¶
- none = 'none'¶
- class selenium.webdriver.common.options.BaseOptions[source]¶
Base class for individual browser options.
- browser_version¶
Gets and Sets the version of the browser.
Usage¶
- Get
self.browser_version
- Set
self.browser_version = value
Parameters¶
value: str
Returns¶
- Get
str
- Set
None
- platform_name¶
Gets and Sets name of the platform.
Usage¶
- Get
self.platform_name
- Set
self.platform_name = value
Parameters¶
value: str
Returns¶
- Get
str
- Set
None
- 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¶
- Get
bool
- Set
None
- 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¶
- Get
bool
- Set
None
- 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¶
- Get
bool
- Set
None
- 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¶
- Get
bool
- Set
None
- 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¶
- Get
str
- Set
None
- 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¶
- Get
str
- Set
None
- 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¶
- Get
dict
- Set
None
- proxy¶
Sets and Gets Proxy.
Usage¶
- Get
self.proxy
- Set
self.proxy = value
Parameters¶
value: Proxy
Returns¶
- Get
Proxy
- Set
None
- enable_downloads¶
Gets and Sets whether session can download files.
Usage¶
- Get
self.enable_downloads
- Set
self.enable_downloads = value
Parameters¶
value: bool
Returns¶
- Get
bool
- Set
None
- web_socket_url¶
Gets and Sets WebSocket URL.
Usage¶
- Get
self.web_socket_url
- Set
self.web_socket_url = value
Parameters¶
value: bool
Returns¶
- Get
bool
- Set
None
- property capabilities¶
- enable_mobile(android_package: str | None = None, android_activity: str | None = None, device_serial: str | None = None) None [source]¶
Enables mobile browser use for browsers that support it.
- Args:
android_activity: The name of the android package to start
- abstract property default_capabilities¶
Return minimal capabilities necessary as a dictionary.
- class selenium.webdriver.common.options.ArgOptions[source]¶
- property capabilities¶
- enable_mobile(android_package: str | None = None, android_activity: str | None = None, device_serial: str | None = None) None ¶
Enables mobile browser use for browsers that support it.
- Args:
android_activity: The name of the android package to start
- set_capability(name, value) None ¶
Sets a capability.
- browser_version¶
Gets and Sets the version of the browser.
Usage¶
- Get
self.browser_version
- Set
self.browser_version = value
Parameters¶
value: str
Returns¶
- Get
str
- Set
None
- platform_name¶
Gets and Sets name of the platform.
Usage¶
- Get
self.platform_name
- Set
self.platform_name = value
Parameters¶
value: str
Returns¶
- Get
str
- Set
None
- 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¶
- Get
bool
- Set
None
- 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¶
- Get
bool
- Set
None
- 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¶
- Get
bool
- Set
None
- 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¶
- Get
bool
- Set
None
- web_socket_url¶
Gets and Sets WebSocket URL.
Usage¶
- Get
self.web_socket_url
- Set
self.web_socket_url = value
Parameters¶
value: bool
Returns¶
- Get
bool
- Set
None
- 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¶
- Get
str
- Set
None
- 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¶
- Get
str
- Set
None
- 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¶
- Get
dict
- Set
None
- proxy¶
Sets and Gets Proxy.
Usage¶
- Get
self.proxy
- Set
self.proxy = value
Parameters¶
value: Proxy
Returns¶
- Get
Proxy
- Set
None
- enable_downloads¶
Gets and Sets whether session can download files.
Usage¶
- Get
self.enable_downloads
- Set
self.enable_downloads = value
Parameters¶
value: bool
Returns¶
- Get
bool
- Set
None
- BINARY_LOCATION_ERROR = 'Binary Location Must be a String'¶
- property arguments¶
- Returns:
A list of arguments needed for the browser.
- ignore_local_proxy_environment_variables() None [source]¶
By calling this you will ignore HTTP_PROXY and HTTPS_PROXY from being picked up and used.
- property default_capabilities¶
Return minimal capabilities necessary as a dictionary.