osn-selenium 0.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. osn_selenium/__init__.py +1 -0
  2. osn_selenium/browsers_handler/__init__.py +70 -0
  3. osn_selenium/browsers_handler/_windows.py +130 -0
  4. osn_selenium/browsers_handler/types.py +20 -0
  5. osn_selenium/captcha_workers/__init__.py +26 -0
  6. osn_selenium/dev_tools/__init__.py +1 -0
  7. osn_selenium/dev_tools/_types.py +22 -0
  8. osn_selenium/dev_tools/domains/__init__.py +63 -0
  9. osn_selenium/dev_tools/domains/abstract.py +378 -0
  10. osn_selenium/dev_tools/domains/fetch.py +1295 -0
  11. osn_selenium/dev_tools/domains_default/__init__.py +1 -0
  12. osn_selenium/dev_tools/domains_default/fetch.py +155 -0
  13. osn_selenium/dev_tools/errors.py +89 -0
  14. osn_selenium/dev_tools/logger.py +558 -0
  15. osn_selenium/dev_tools/manager.py +1551 -0
  16. osn_selenium/dev_tools/utils.py +509 -0
  17. osn_selenium/errors.py +16 -0
  18. osn_selenium/types.py +118 -0
  19. osn_selenium/webdrivers/BaseDriver/__init__.py +1 -0
  20. osn_selenium/webdrivers/BaseDriver/_utils.py +37 -0
  21. osn_selenium/webdrivers/BaseDriver/flags.py +644 -0
  22. osn_selenium/webdrivers/BaseDriver/protocols.py +2135 -0
  23. osn_selenium/webdrivers/BaseDriver/trio_wrapper.py +71 -0
  24. osn_selenium/webdrivers/BaseDriver/webdriver.py +2626 -0
  25. osn_selenium/webdrivers/Blink/__init__.py +1 -0
  26. osn_selenium/webdrivers/Blink/flags.py +1349 -0
  27. osn_selenium/webdrivers/Blink/protocols.py +330 -0
  28. osn_selenium/webdrivers/Blink/webdriver.py +637 -0
  29. osn_selenium/webdrivers/Chrome/__init__.py +1 -0
  30. osn_selenium/webdrivers/Chrome/flags.py +192 -0
  31. osn_selenium/webdrivers/Chrome/protocols.py +228 -0
  32. osn_selenium/webdrivers/Chrome/webdriver.py +394 -0
  33. osn_selenium/webdrivers/Edge/__init__.py +1 -0
  34. osn_selenium/webdrivers/Edge/flags.py +192 -0
  35. osn_selenium/webdrivers/Edge/protocols.py +228 -0
  36. osn_selenium/webdrivers/Edge/webdriver.py +394 -0
  37. osn_selenium/webdrivers/Yandex/__init__.py +1 -0
  38. osn_selenium/webdrivers/Yandex/flags.py +192 -0
  39. osn_selenium/webdrivers/Yandex/protocols.py +211 -0
  40. osn_selenium/webdrivers/Yandex/webdriver.py +350 -0
  41. osn_selenium/webdrivers/__init__.py +1 -0
  42. osn_selenium/webdrivers/_functions.py +504 -0
  43. osn_selenium/webdrivers/js_scripts/check_element_in_viewport.js +18 -0
  44. osn_selenium/webdrivers/js_scripts/get_document_scroll_size.js +4 -0
  45. osn_selenium/webdrivers/js_scripts/get_element_css.js +6 -0
  46. osn_selenium/webdrivers/js_scripts/get_element_rect_in_viewport.js +9 -0
  47. osn_selenium/webdrivers/js_scripts/get_random_element_point_in_viewport.js +59 -0
  48. osn_selenium/webdrivers/js_scripts/get_viewport_position.js +4 -0
  49. osn_selenium/webdrivers/js_scripts/get_viewport_rect.js +6 -0
  50. osn_selenium/webdrivers/js_scripts/get_viewport_size.js +4 -0
  51. osn_selenium/webdrivers/js_scripts/open_new_tab.js +1 -0
  52. osn_selenium/webdrivers/js_scripts/stop_window_loading.js +1 -0
  53. osn_selenium/webdrivers/types.py +390 -0
  54. osn_selenium-0.0.0.dist-info/METADATA +710 -0
  55. osn_selenium-0.0.0.dist-info/RECORD +57 -0
  56. osn_selenium-0.0.0.dist-info/WHEEL +5 -0
  57. osn_selenium-0.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,192 @@
1
+ import pathlib
2
+ from typing import (
3
+ Optional,
4
+ TypedDict,
5
+ Union
6
+ )
7
+ from selenium.webdriver.chrome.options import Options
8
+ from osn_selenium.webdrivers.types import (
9
+ FlagDefinition,
10
+ FlagType
11
+ )
12
+ from osn_selenium.webdrivers.Blink.flags import (
13
+ BlinkArguments,
14
+ BlinkAttributes,
15
+ BlinkExperimentalOptions,
16
+ BlinkFeatures,
17
+ BlinkFlagsManager
18
+ )
19
+
20
+
21
+ class ChromeFlagsManager(BlinkFlagsManager):
22
+ """
23
+ Manages Chrome Browser-specific options for Selenium WebDriver.
24
+
25
+ This class extends BrowserOptionsManager to provide specific configurations
26
+ for Chrome Browser options, such as experimental options and arguments.
27
+
28
+ Attributes:
29
+ """
30
+
31
+ def __init__(
32
+ self,
33
+ browser_exe: Optional[Union[str, pathlib.Path]] = None,
34
+ start_page_url: Optional[str] = None,
35
+ flags_types: Optional[dict[str, FlagType]] = None,
36
+ flags_definitions: Optional[dict[str, FlagDefinition]] = None
37
+ ):
38
+ """
39
+ Initializes ChromeOptionsManager.
40
+
41
+ Sets up the Chrome Browser options manager with specific option configurations for
42
+ debugging port, user agent, proxy, and BiDi protocol.
43
+ """
44
+
45
+ yandex_flags_types = {}
46
+
47
+ if flags_types is not None:
48
+ yandex_flags_types.update(flags_types)
49
+
50
+ yandex_flags_definitions = {}
51
+
52
+ if flags_definitions is not None:
53
+ yandex_flags_definitions.update(flags_definitions)
54
+
55
+ super().__init__(
56
+ browser_exe=browser_exe,
57
+ start_page_url=start_page_url,
58
+ flags_types=yandex_flags_types,
59
+ flags_definitions=yandex_flags_definitions,
60
+ )
61
+
62
+ def _renew_webdriver_options(self) -> Options:
63
+ """
64
+ Creates and returns a new Options object.
65
+
66
+ Returns a fresh instance of `webdriver.ChromeOptions`, as Chrome Browser is based on Chromium,
67
+ allowing for a clean state of browser options to be configured.
68
+
69
+ Returns:
70
+ Options: A new Selenium Chrome Browser options object, based on ChromeOptions.
71
+ """
72
+
73
+ return Options()
74
+
75
+
76
+ class ChromeAttributes(BlinkAttributes, total=False):
77
+ """
78
+ Typed dictionary for WebDriver attributes specific to Chrome browsers.
79
+
80
+ Attributes:
81
+ enable_bidi (Optional[bool]): Enables/disables BiDi (Bidirectional) protocol mapper.
82
+ """
83
+
84
+ pass
85
+
86
+
87
+ class ChromeExperimentalOptions(BlinkExperimentalOptions, total=False):
88
+ """
89
+ Typed dictionary for experimental options specific to Chrome browsers.
90
+
91
+ Attributes:
92
+ debugger_address (Optional[str]): The address (IP:port) of the remote debugger.
93
+ """
94
+
95
+ pass
96
+
97
+
98
+ class ChromeArguments(BlinkArguments, total=False):
99
+ """
100
+ Typed dictionary for command-line arguments specific to Chrome browsers.
101
+
102
+ Attributes:
103
+ se_downloads_enabled (bool): Enables/disables Selenium downloads.
104
+ headless_mode (bool): Runs the browser in headless mode (without a UI).
105
+ mute_audio (bool): Mutes audio output from the browser.
106
+ no_first_run (bool): Prevents the browser from showing the "first run" experience.
107
+ disable_background_timer_throttling (bool): Disables throttling of background timers.
108
+ disable_backgrounding_occluded_windows (bool): Prevents backgrounding of occluded windows.
109
+ disable_hang_monitor (bool): Disables the browser's hang monitor.
110
+ disable_ipc_flooding_protection (bool): Disables IPC flooding protection.
111
+ disable_renderer_backgrounding (bool): Prevents renderer processes from being backgrounded.
112
+ disable_back_forward_cache (bool): Disables the Back-Forward Cache.
113
+ disable_notifications (bool): Disables web notifications.
114
+ disable_popup_blocking (bool): Disables the built-in popup blocker.
115
+ disable_prompt_on_repost (bool): Disables the prompt when reposting form data.
116
+ disable_sync (bool): Disables browser synchronization features.
117
+ disable_background_networking (bool): Disables background network activity.
118
+ disable_breakpad (bool): Disables the crash reporter.
119
+ disable_component_update (bool): Disables component updates.
120
+ disable_domain_reliability (bool): Disables domain reliability monitoring.
121
+ disable_new_content_rendering_timeout (bool): Disables timeout for new content rendering.
122
+ disable_threaded_animation (bool): Disables threaded animation.
123
+ disable_threaded_scrolling (bool): Disables threaded scrolling.
124
+ disable_checker_imaging (bool): Disables checker imaging.
125
+ disable_image_animation_resync (bool): Disables image animation resynchronization.
126
+ disable_partial_raster (bool): Disables partial rasterization.
127
+ disable_skia_runtime_opts (bool): Disables Skia runtime optimizations.
128
+ disable_dev_shm_usage (bool): Disables the use of /dev/shm (important for Docker).
129
+ disable_gpu (bool): Disables GPU hardware acceleration.
130
+ aggressive_cache_discard (bool): Enables aggressive discarding of cached data.
131
+ allow_running_insecure_content (bool): Allows running insecure content on HTTPS pages.
132
+ no_process_per_site (bool): Runs all sites in a single process (less secure, but saves memory).
133
+ enable_precise_memory_info (bool): Enables precise memory information reporting.
134
+ use_fake_device_for_media_stream (bool): Uses a fake camera/microphone for media streams.
135
+ use_fake_ui_for_media_stream (bool): Uses a fake UI for media stream requests.
136
+ deny_permission_prompts (bool): Automatically denies all permission prompts.
137
+ disable_external_intent_requests (bool): Disables external intent requests.
138
+ noerrdialogs (bool): Suppresses error dialogs.
139
+ enable_automation (bool): Enables automation features.
140
+ test_type (bool): Sets the browser to test mode.
141
+ remote_debugging_pipe (bool): Uses a pipe for remote debugging instead of a port.
142
+ silent_debugger_extension_api (bool): Silences debugger extension API warnings.
143
+ enable_logging_stderr (bool): Enables logging to stderr.
144
+ password_store_basic (bool): Uses a basic password store.
145
+ use_mock_keychain (bool): Uses a mock keychain for testing.
146
+ enable_crash_reporter_for_testing (bool): Enables crash reporter for testing purposes.
147
+ metrics_recording_only (bool): Records metrics without sending them.
148
+ no_pings (bool): Disables sending pings.
149
+ allow_pre_commit_input (bool): Allows pre-commit input.
150
+ deterministic_mode (bool): Runs the browser in a more deterministic mode.
151
+ run_all_compositor_stages_before_draw (bool): Runs all compositor stages before drawing.
152
+ enable_begin_frame_control (bool): Enables begin frame control.
153
+ in_process_gpu (bool): Runs the GPU process in-process.
154
+ block_new_web_contents (bool): Blocks new web contents (e.g., pop-ups).
155
+ new_window (bool): Opens a new window instead of a new tab.
156
+ no_service_autorun (bool): Disables service autorun.
157
+ process_per_tab (bool): Runs each tab in its own process.
158
+ single_process (bool): Runs the browser in a single process (less stable).
159
+ no_sandbox (bool): Disables the sandbox (less secure, but can fix some issues).
160
+ user_agent (Optional[str]): Sets a custom user agent string.
161
+ user_data_dir (Optional[str]): Specifies the user data directory.
162
+ proxy_server (Optional[str]): Specifies a proxy server to use.
163
+ remote_debugging_port (Optional[int]): Specifies the remote debugging port.
164
+ remote_debugging_address (Optional[str]): Specifies the remote debugging address.
165
+ use_file_for_fake_video_capture (Optional[Union[str, pathlib.Path]]): Uses a file for fake video capture.
166
+ autoplay_policy (Optional[AutoplayPolicyType]): Sets the autoplay policy.
167
+ log_level (Optional[LogLevelType]): Sets the browser's log level.
168
+ use_gl (Optional[UseGLType]): Specifies the GL backend to use.
169
+ force_color_profile (Optional[str]): Forces a specific color profile.
170
+ """
171
+
172
+ pass
173
+
174
+
175
+ class ChromeFlags(TypedDict, total=False):
176
+ """
177
+ Typed dictionary representing a collection of all flag types for Chrome browsers.
178
+
179
+ This combines arguments, experimental options, attributes, and Blink features
180
+ that are specific to Chrome browsers.
181
+
182
+ Attributes:
183
+ argument (ChromeArguments): Command-line arguments for the Chrome browser.
184
+ experimental_option (ChromeExperimentalOptions): Experimental options for WebDriver specific to Chrome.
185
+ attribute (ChromeAttributes): WebDriver attributes specific to Chrome.
186
+ blink_feature (BlinkFeatures): Blink-specific feature flags.
187
+ """
188
+
189
+ argument: ChromeArguments
190
+ experimental_option: ChromeExperimentalOptions
191
+ attribute: ChromeAttributes
192
+ blink_feature: BlinkFeatures
@@ -0,0 +1,228 @@
1
+ import pathlib
2
+ from selenium import webdriver
3
+ from osn_selenium.types import WindowRect
4
+ from osn_selenium.webdrivers.types import _any_flags_mapping
5
+ from osn_selenium.webdrivers.Chrome.flags import ChromeFlagsManager
6
+ from typing import (
7
+ Optional,
8
+ Protocol,
9
+ TYPE_CHECKING,
10
+ Union,
11
+ runtime_checkable
12
+ )
13
+ from osn_selenium.webdrivers.Blink.protocols import (
14
+ TrioBlinkWebDriverWrapperProtocol
15
+ )
16
+
17
+
18
+ if TYPE_CHECKING:
19
+ from osn_selenium.webdrivers.Chrome.webdriver import ChromeWebDriver, ChromeFlags
20
+
21
+
22
+ @runtime_checkable
23
+ class TrioChromeWebDriverWrapperProtocol(TrioBlinkWebDriverWrapperProtocol, Protocol):
24
+ """
25
+ Wraps ChromeWebDriver methods for asynchronous execution using Trio.
26
+
27
+ This class acts as a proxy to a `BrowserWebDriver` instance. It intercepts
28
+ method calls and executes them in a separate thread using `trio.to_thread.run_sync`,
29
+ allowing synchronous WebDriver operations to be called from asynchronous Trio code
30
+ without blocking the event loop. Properties and non-callable attributes are accessed directly.
31
+
32
+ Attributes:
33
+ _webdriver (BrowserWebDriver): The underlying synchronous BrowserWebDriver instance.
34
+ _excluding_functions (list[str]): A list of attribute names on the wrapped object
35
+ that should *not* be accessible through this wrapper,
36
+ typically because they are irrelevant or dangerous
37
+ in an async context handled by the wrapper.
38
+ """
39
+
40
+ _webdriver: "ChromeWebDriver"
41
+ _webdriver_flags_manager: "ChromeFlagsManager"
42
+ _driver: Optional[webdriver.Chrome]
43
+
44
+ @property
45
+ def driver(self) -> Optional[webdriver.Chrome]:
46
+ """
47
+ Gets the underlying Selenium WebDriver instance associated with this object.
48
+
49
+ This property provides direct access to the WebDriver object (e.g., Chrome)
50
+ that is being controlled, allowing for direct Selenium operations if needed.
51
+
52
+ Returns:
53
+ Optional[webdriver.Chrome]:
54
+ The active WebDriver instance, or None if no driver is currently set or active.
55
+ """
56
+
57
+ ...
58
+
59
+ def reset_settings(
60
+ self,
61
+ flags: Optional[Union["ChromeFlags", _any_flags_mapping]] = None,
62
+ browser_exe: Optional[Union[str, pathlib.Path]] = None,
63
+ browser_name_in_system: Optional[str] = None,
64
+ use_browser_exe: Optional[bool] = None,
65
+ start_page_url: str = "",
66
+ window_rect: Optional[WindowRect] = None,
67
+ trio_tokens_limit: Union[int, float] = 40,
68
+ ):
69
+ """
70
+ Resets various configurable browser settings to their specified or default values.
71
+
72
+ This method allows for reconfiguring the WebDriver's operational parameters,
73
+ such as browser flags, executable path, start URL, window dimensions, and
74
+ concurrency limits. It is crucial that the browser session is *not* active
75
+ when this method is called; otherwise, a warning will be issued, and no changes
76
+ will be applied.
77
+
78
+ Args:
79
+ flags (Optional[Union[ChromeFlags, Mapping[str, Any]]]): New browser flags to apply.
80
+ If provided, existing flags are cleared and replaced with these.
81
+ If `None`, all custom flags are cleared, and the browser will start with default flags.
82
+ browser_exe (Optional[Union[str, pathlib.Path]]): The explicit path to the browser executable.
83
+ If provided, this path will be used. If `None`, the executable path managed by the
84
+ flags manager will be cleared, and then potentially re-detected based on
85
+ `use_browser_exe` and `browser_name_in_system`.
86
+ browser_name_in_system (Optional[str]): The common name of the browser (e.g., "Chrome", "Edge").
87
+ Used in conjunction with `use_browser_exe` to automatically detect the browser executable path.
88
+ This parameter only takes effect if `use_browser_exe` is explicitly `True` or `False`.
89
+ If `None`, no automatic detection based on name will occur through this method call.
90
+ use_browser_exe (Optional[bool]): Controls the automatic detection of the browser executable.
91
+ If `True` (and `browser_name_in_system` is provided), the browser executable path
92
+ will be automatically detected if `browser_exe` is `None`.
93
+ If `False` (and `browser_name_in_system` is provided), any existing `browser_exe`
94
+ path in the flags manager will be cleared.
95
+ If `None`, the current `use_browser_exe` state is maintained for the `_detect_browser_exe` logic.
96
+ start_page_url (str): The URL that the browser will attempt to navigate to
97
+ immediately after starting. Defaults to an empty string.
98
+ window_rect (Optional[WindowRect]): The initial window size and position settings.
99
+ If `None`, it defaults to a new `WindowRect()` instance, effectively resetting
100
+ to the browser's default window behavior.
101
+ trio_tokens_limit (Union[int, float]): The maximum number of concurrent synchronous
102
+ WebDriver operations allowed by the Trio capacity limiter. Defaults to 40.
103
+ """
104
+
105
+ ...
106
+
107
+ def restart_webdriver(
108
+ self,
109
+ flags: Optional[Union["ChromeFlags", _any_flags_mapping]] = None,
110
+ browser_exe: Optional[Union[str, pathlib.Path]] = None,
111
+ browser_name_in_system: Optional[str] = None,
112
+ use_browser_exe: Optional[bool] = None,
113
+ start_page_url: Optional[str] = None,
114
+ window_rect: Optional[WindowRect] = None,
115
+ trio_tokens_limit: Optional[Union[int, float]] = None,
116
+ ):
117
+ """
118
+ Restarts the WebDriver and browser session gracefully.
119
+
120
+ Performs a clean restart by first closing the existing WebDriver session and browser
121
+ (using `close_webdriver`), and then initiating a new session (using `start_webdriver`)
122
+ with potentially updated settings. If settings arguments are provided, they override
123
+ the existing settings for the new session; otherwise, the current settings are used.
124
+
125
+ Args:
126
+ flags (Optional[Union[ChromeFlags, Mapping[str, Any]]]): Override flags for the new session.
127
+ If provided, these flags will be applied. If `None`, current settings are used.
128
+ browser_exe (Optional[Union[str, pathlib.Path]]): Override browser executable for the new session.
129
+ If provided, this path will be used. If `None`, current settings are used.
130
+ browser_name_in_system (Optional[str]): Override browser name for auto-detection for the new session.
131
+ Only takes effect if `use_browser_exe` is also provided. If `None`, current settings are used.
132
+ use_browser_exe (Optional[bool]): Override auto-detection behavior for the new session.
133
+ If provided, this boolean determines if the browser executable is auto-detected.
134
+ If `None`, current settings are used.
135
+ start_page_url (Optional[str]): Override start page URL for the new session.
136
+ If provided, this URL will be used. If `None`, current setting is used.
137
+ window_rect (Optional[WindowRect]): Override window rectangle for the new session.
138
+ If provided, these dimensions will be used. If `None`, current settings are used.
139
+ trio_tokens_limit (Optional[Union[int, float]]): Override Trio token limit for the new session.
140
+ If provided, this limit will be used. If `None`, current setting is used.
141
+ """
142
+
143
+ ...
144
+
145
+ def start_webdriver(
146
+ self,
147
+ flags: Optional[Union["ChromeFlags", _any_flags_mapping]] = None,
148
+ browser_exe: Optional[Union[str, pathlib.Path]] = None,
149
+ browser_name_in_system: Optional[str] = None,
150
+ use_browser_exe: Optional[bool] = None,
151
+ start_page_url: Optional[str] = None,
152
+ window_rect: Optional[WindowRect] = None,
153
+ trio_tokens_limit: Optional[Union[int, float]] = None,
154
+ ):
155
+ """
156
+ Starts the WebDriver service and the browser session.
157
+
158
+ Initializes and starts the WebDriver instance and the associated browser process.
159
+ It first updates settings based on provided parameters (if the driver is not already running),
160
+ checks if a browser process needs to be started, starts it if necessary using Popen,
161
+ waits for it to become active, and then creates the WebDriver client instance (`self.driver`).
162
+
163
+ Args:
164
+ flags (Optional[Union[ChromeFlags, Mapping[str, Any]]]): Override flags for this start.
165
+ If provided, these flags will be applied. If `None`, current settings are used.
166
+ browser_exe (Optional[Union[str, pathlib.Path]]): Override browser executable path for this start.
167
+ If provided, this path will be used. If `None`, current settings are used.
168
+ browser_name_in_system (Optional[str]): Override browser name for auto-detection for this start.
169
+ Only takes effect if `use_browser_exe` is also provided. If `None`, current settings are used.
170
+ use_browser_exe (Optional[bool]): Override auto-detection behavior for this start.
171
+ If provided, this boolean determines if the browser executable is auto-detected.
172
+ If `None`, current settings are used.
173
+ start_page_url (Optional[str]): Override start page URL for this start.
174
+ If provided, this URL will be used. If `None`, current setting is used.
175
+ window_rect (Optional[WindowRect]): Override window rectangle for this start.
176
+ If provided, these dimensions will be used. If `None`, current settings are used.
177
+ trio_tokens_limit (Optional[Union[int, float]]): Override Trio token limit for this start.
178
+ If provided, this limit will be used. If `None`, current setting is used.
179
+ """
180
+
181
+ ...
182
+
183
+ def update_settings(
184
+ self,
185
+ flags: Optional[Union["ChromeFlags", _any_flags_mapping]] = None,
186
+ browser_exe: Optional[Union[str, pathlib.Path]] = None,
187
+ browser_name_in_system: Optional[str] = None,
188
+ use_browser_exe: Optional[bool] = None,
189
+ start_page_url: Optional[str] = None,
190
+ window_rect: Optional[WindowRect] = None,
191
+ trio_tokens_limit: Optional[Union[int, float]] = None,
192
+ ):
193
+ """
194
+ Updates various browser settings selectively without resetting others.
195
+
196
+ This method allows for dynamic updating of browser settings. Only the settings
197
+ for which a non-None value is provided will be updated. Settings passed as `None`
198
+ will retain their current values. This method can be called whether the browser
199
+ is active or not, but some changes might only take effect after the browser is
200
+ restarted.
201
+
202
+ Args:
203
+ flags (Optional[Union[ChromeFlags, Mapping[str, Any]]]): New browser flags to update.
204
+ If provided, these flags will be merged with or overwrite existing flags
205
+ within the flags manager. If `None`, existing flags remain unchanged.
206
+ browser_exe (Optional[Union[str, pathlib.Path]]): The new path to the browser executable.
207
+ If provided, this path will be set in the flags manager. If `None`, the
208
+ current browser executable path remains unchanged.
209
+ browser_name_in_system (Optional[str]): The common name of the browser (e.g., "Chrome", "Edge").
210
+ Used in conjunction with `use_browser_exe` to automatically detect the browser executable path.
211
+ This parameter only takes effect if `use_browser_exe` is explicitly provided.
212
+ If `None`, no automatic detection based on name will occur through this method call.
213
+ use_browser_exe (Optional[bool]): Controls the automatic detection of the browser executable.
214
+ If `True` (and `browser_name_in_system` is provided), the browser executable path
215
+ will be automatically detected if `browser_exe` is `None`.
216
+ If `False` (and `browser_name_in_system` is provided), any existing `browser_exe`
217
+ path in the flags manager will be cleared.
218
+ If `None`, the current `use_browser_exe` state is maintained for the `_detect_browser_exe` logic.
219
+ start_page_url (Optional[str]): The new URL that the browser will attempt to navigate to
220
+ immediately after starting. If `None`, the current start page URL remains unchanged.
221
+ window_rect (Optional[WindowRect]): The new window size and position settings.
222
+ If `None`, the current window rectangle settings remain unchanged.
223
+ trio_tokens_limit (Optional[Union[int, float]]): The new maximum number of concurrent
224
+ asynchronous operations allowed by the Trio capacity limiter. If `None`, the
225
+ current limit remains unchanged.
226
+ """
227
+
228
+ ...