Tab
Drives a single browser tab: navigation, finding elements, input, screenshots, events, and network. Learn more in Core concepts.
pydoll.browser.tab.Tab
Tab(browser, connection_port=None, target_id=None, browser_context_id=None, ws_address=None, connection_handler=None)
Bases: FindElementsMixin
Controls a browser tab via Chrome DevTools Protocol.
Primary interface for web page automation including navigation, DOM manipulation, JavaScript execution, event handling, network monitoring, and specialized tasks like Cloudflare Turnstile handling.
Initialize tab controller for existing browser tab.
| PARAMETER | DESCRIPTION |
|---|---|
browser
|
Browser instance that created this tab.
TYPE:
|
connection_port
|
CDP WebSocket port.
TYPE:
|
target_id
|
CDP target identifier for this tab.
TYPE:
|
browser_context_id
|
Optional browser context ID.
TYPE:
|
ws_address
|
Optional WebSocket address for this tab.
TYPE:
|
connection_handler
|
Pre-built connection handler; created from connection details when omitted (mainly for testing).
TYPE:
|
browser_context_id
property
Browser context this tab belongs to (None for the default context).
network_events_enabled
property
Whether CDP Network domain events are enabled.
fetch_events_enabled
property
Whether CDP Fetch domain events (request interception) are enabled.
runtime_events_enabled
property
Whether CDP Runtime domain events are enabled.
request
property
Get the request object for making HTTP requests using the browser's fetch API.
| RETURNS | DESCRIPTION |
|---|---|
Request
|
An instance of the Request class for making HTTP requests.
TYPE:
|
scroll
property
Get the scroll API for controlling page scroll behavior.
| RETURNS | DESCRIPTION |
|---|---|
ScrollAPI
|
An instance of the ScrollAPI class for scroll operations.
TYPE:
|
keyboard
property
Get the keyboard API for controlling keyboard input at page level.
| RETURNS | DESCRIPTION |
|---|---|
KeyboardAPI
|
An instance of the KeyboardAPI class for keyboard operations.
TYPE:
|
mouse
property
Get the mouse API for controlling mouse input.
| RETURNS | DESCRIPTION |
|---|---|
MouseAPI
|
An instance of the MouseAPI class for mouse operations.
TYPE:
|
intercept_file_chooser_dialog_enabled
property
Whether file chooser dialog interception is active.
extract
async
Extract structured data from the page into a typed model.
| PARAMETER | DESCRIPTION |
|---|---|
model
|
ExtractionModel subclass defining the extraction schema.
TYPE:
|
scope
|
Optional CSS/XPath selector to limit extraction region.
TYPE:
|
timeout
|
Seconds to wait for elements (0 = no wait).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
T
|
Populated model instance with extracted data. |
| RAISES | DESCRIPTION |
|---|---|
FieldExtractionFailed
|
If a required field cannot be extracted. |
InvalidExtractionModel
|
If model definition is invalid. |
extract_all
async
Extract multiple items from repeated containers on the page.
Each element matching the scope selector generates one model instance. Fields are resolved relative to each scope container.
| PARAMETER | DESCRIPTION |
|---|---|
model
|
ExtractionModel subclass defining the extraction schema.
TYPE:
|
scope
|
CSS/XPath selector for the repeated container (required).
TYPE:
|
timeout
|
Seconds to wait for elements (0 = no wait).
TYPE:
|
limit
|
Maximum number of items to extract (None = all).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[T]
|
List of populated model instances. |
current_url
async
Get current page URL (reflects redirects and client-side navigation).
enable_page_events
async
Enable CDP Page domain events (load, navigation, dialogs, etc.).
enable_network_events
async
Enable CDP Network domain events (requests, responses, etc.).
enable_fetch_events
async
Enable CDP Fetch domain for request interception.
| PARAMETER | DESCRIPTION |
|---|---|
handle_auth
|
Intercept authentication challenges.
TYPE:
|
resource_type
|
Filter by resource type (all if None).
TYPE:
|
request_stage
|
When to intercept (Request/Response).
TYPE:
|
Note
Intercepted requests must be explicitly continued or timeout.
enable_dom_events
async
Enable CDP DOM domain events (document structure changes).
enable_intercept_file_chooser_dialog
async
Enable file chooser dialog interception for automated uploads.
Note
Use expect_file_chooser context manager for convenience.
disable_fetch_events
async
Disable CDP Fetch domain and release paused requests.
disable_intercept_file_chooser_dialog
async
Disable file chooser dialog interception.
close
async
Close this browser tab.
Note
Tab instance becomes invalid after calling this method.
find_shadow_roots
async
Find all shadow roots in the page.
Traverses the entire DOM tree (including iframes and nested shadow DOMs) to collect all shadow roots found. This is especially useful when the shadow host element selector is unknown or dynamic (e.g., Cloudflare challenge pages).
| PARAMETER | DESCRIPTION |
|---|---|
deep
|
If True, also traverses cross-origin iframes (OOPIFs) to discover shadow roots inside them. The returned ShadowRoot objects will automatically route CDP commands through the correct OOPIF session.
TYPE:
|
timeout
|
Maximum seconds to wait for shadow roots to appear. When > 0, repeatedly polls the DOM (starting every 20 ms and backing off to 250 ms) until at least one shadow root is found or the timeout expires. Useful when shadow hosts are injected asynchronously (e.g., Cloudflare Turnstile loading inside an OOPIF).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[ShadowRoot]
|
List of ShadowRoot instances found in the page. |
| RAISES | DESCRIPTION |
|---|---|
WaitElementTimeout
|
If timeout > 0 and no shadow roots are found within the specified duration. |
get_cookies
async
Get all cookies of this tab's browser context.
A tab that lives in a browser context created with
browser.create_browser_context() reads them through the browser
connection, because Chrome only accepts browserContextId on the
browser target, not on a page session.
get_network_response_body
async
Get the response body for a given request ID.
| PARAMETER | DESCRIPTION |
|---|---|
request_id
|
Request ID to get the response body for.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The response body for the given request ID. |
| RAISES | DESCRIPTION |
|---|---|
NetworkEventsNotEnabled
|
If network events are not enabled. |
get_network_logs
async
Get network logs.
| PARAMETER | DESCRIPTION |
|---|---|
filter
|
Filter to apply to the network logs.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[RequestWillBeSentEvent]
|
The network logs. |
| RAISES | DESCRIPTION |
|---|---|
NetworkEventsNotEnabled
|
If network events are not enabled. |
set_cookies
async
Set multiple cookies for current page.
| PARAMETER | DESCRIPTION |
|---|---|
cookies
|
Cookie parameters (name/value required, others optional).
TYPE:
|
Note
Defaults to current page's domain if not specified.
apply_fingerprint
async
Apply a browser fingerprint profile to this tab.
Delegates to a per-tab :class:FingerprintApplier (created once and
reused), which overrides browser identity signals via CDP commands and
JavaScript injection and replays them on Web Worker targets and cross-site
iframes. Call before navigating to any page for full effect, since JS
overrides register via Page.addScriptToEvaluateOnNewDocument.
| PARAMETER | DESCRIPTION |
|---|---|
fingerprint
|
Fingerprint configuration. Only specified fields are overridden; unspecified fields keep real browser values.
TYPE:
|
cross_origin_iframes
|
When true (default), the identity is also replayed into every cross-site iframe (OOPIF), so a fingerprinting script embedded in a cross-origin challenge or captcha frame reads the same identity as the page. Set false to cover only the top page, same-origin frames, and workers.
TYPE:
|
go_to
async
Navigate to URL and wait for loading to complete.
| PARAMETER | DESCRIPTION |
|---|---|
url
|
Target URL to navigate to.
TYPE:
|
timeout
|
Maximum seconds to wait for page load (default 300).
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
NavigationError
|
If the navigation fails (e.g., DNS error). |
PageLoadTimeout
|
If page doesn't finish loading within timeout. |
wait_for_url
async
Wait until the tab's URL matches a pattern and return it.
Covers full navigations and in-page changes (pushState) alike,
because it reads the live URL instead of listening to one event.
| PARAMETER | DESCRIPTION |
|---|---|
url
|
A glob (
TYPE:
|
timeout
|
Maximum seconds to wait.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The URL that matched. |
| RAISES | DESCRIPTION |
|---|---|
WaitTimeout
|
If no matching URL is seen within |
wait_for_script
async
Wait until a JavaScript expression evaluates to a truthy value and return it.
Truthiness is JavaScript's, judged on the page side: a DOM node, a
function, an object (even {} or []) and a non-empty string or
non-zero number are truthy; undefined, null, false, 0,
NaN, -0, 0n and '' are falsy. A promise is awaited and
its settled value is judged.
| PARAMETER | DESCRIPTION |
|---|---|
script
|
An expression such as
TYPE:
|
timeout
|
Maximum seconds to wait.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Any
|
The value itself when it is a primitive (string, number, |
Any
|
|
| RAISES | DESCRIPTION |
|---|---|
WaitTimeout
|
If the script stays falsy for |
ScriptEvaluationError
|
As soon as the script throws or its promise rejects, with the JavaScript error text. |
wait_for_absence
async
wait_for_absence(id=None, class_name=None, name=None, tag_name=None, text=None, timeout=30, **attributes)
Wait until no element matches the criteria, the same criteria find() takes.
Use it for the thing that has to go away before you continue: a loading overlay, a "saving" badge, a modal that closes on its own.
| PARAMETER | DESCRIPTION |
|---|---|
id, class_name, name, tag_name, text, **attributes
|
Criteria, as in
|
timeout
|
Maximum seconds to wait.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
WaitTimeout
|
If a matching element is still present after |
wait_for_network_idle
async
Wait until the page has had no network requests in flight for idle_time seconds.
Requests are counted from the moment this method is called, so call
it right after the action that starts them (a navigation, a click that
loads data). A request that never finishes keeps the page busy until
timeout.
| PARAMETER | DESCRIPTION |
|---|---|
idle_time
|
Seconds without any request in flight that count as idle.
TYPE:
|
timeout
|
Maximum seconds to wait.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
WaitTimeout
|
If the network is never idle for |
expect_navigation
async
Wait for a navigation started inside the block, and for the new page to load.
Register before acting, act inside the block, and the block only
exits once the main frame has navigated (to a URL matching url,
when given) and reached the load state set in options.page_load_state.
| PARAMETER | DESCRIPTION |
|---|---|
url
|
Optional glob, regular expression or callable the new URL must match.
TYPE:
|
timeout
|
Maximum seconds to wait after the block.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
WaitTimeout
|
If the navigation or the load does not happen in time. |
expect_request
async
Capture the first request whose URL matches, sent during the block.
The handle is empty inside the block and filled when the block exits, which is when the wait happens.
| PARAMETER | DESCRIPTION |
|---|---|
url
|
A glob, a compiled regular expression, or a callable on the URL.
TYPE:
|
timeout
|
Maximum seconds to wait after the block for the request.
TYPE:
|
| YIELDS | DESCRIPTION |
|---|---|
RequestHandle
|
URL, method, headers and body of the request.
TYPE::
|
| RAISES | DESCRIPTION |
|---|---|
WaitTimeout
|
If no matching request is sent within |
expect_response
async
Capture the first response whose URL matches, received during the block.
The block exits once the response has arrived and its body has been
read, so response.json() is ready right after the block: the usual
way to read the API call a click triggers instead of scraping the DOM.
A 204, 205 or 304 response has no body by definition (Chrome reports
its load as aborted), so it completes with an empty body.
| PARAMETER | DESCRIPTION |
|---|---|
url
|
A glob, a compiled regular expression, or a callable on the URL.
TYPE:
|
timeout
|
Maximum seconds to wait after the block for the response.
TYPE:
|
| YIELDS | DESCRIPTION |
|---|---|
ResponseHandle
|
status, headers and body of the response.
TYPE::
|
| RAISES | DESCRIPTION |
|---|---|
WaitTimeout
|
If no matching response completes within |
refresh
async
Reload current page and wait for completion.
| PARAMETER | DESCRIPTION |
|---|---|
ignore_cache
|
Bypass browser cache if True.
TYPE:
|
script_to_evaluate_on_load
|
JavaScript to execute after load.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
PageLoadTimeout
|
If page doesn't finish loading within timeout. |
take_screenshot
async
Capture screenshot of current page.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
File path for screenshot (extension determines format).
TYPE:
|
quality
|
Image quality 0-100 (default 100).
TYPE:
|
beyond_viewport
|
The page will be scrolled to the bottom and the screenshot will include the entire page
TYPE:
|
as_base64
|
Return as base64 string instead of saving file.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
Base64 screenshot data if as_base64=True, None otherwise. |
| RAISES | DESCRIPTION |
|---|---|
InvalidFileExtension
|
If file extension not supported. |
MissingScreenshotPath
|
If path is None and as_base64 is False. |
print_to_pdf
async
print_to_pdf(path=None, landscape=False, display_header_footer=False, print_background=True, scale=1.0, as_base64=False)
Generate PDF of current page.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
File path for PDF output. Required if as_base64=False.
TYPE:
|
landscape
|
Use landscape orientation.
TYPE:
|
display_header_footer
|
Include header/footer.
TYPE:
|
print_background
|
Include background graphics.
TYPE:
|
scale
|
Scale factor (0.1-2.0).
TYPE:
|
as_base64
|
Return as base64 string instead of saving.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
Base64 PDF data if as_base64=True, None otherwise. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If path is not provided when as_base64=False. |
save_bundle
async
Save current page and its assets as a .zip bundle for offline viewing.
Captures the page HTML along with CSS, JS, images, fonts, and media
into a single zip archive. The archive contains an index.html with
URLs rewritten to reference local asset files.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
Destination path for the
TYPE:
|
inline_assets
|
When True, embed all assets directly into
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
InvalidFileExtension
|
If path does not end with |
has_dialog
async
Check if JavaScript dialog is currently displayed.
Note
Page events must be enabled to detect dialogs.
get_dialog_message
async
Get message text from current JavaScript dialog.
| RAISES | DESCRIPTION |
|---|---|
NoDialogPresent
|
If no dialog is currently displayed. |
handle_dialog
async
Respond to JavaScript dialog.
| PARAMETER | DESCRIPTION |
|---|---|
accept
|
Accept/confirm dialog if True, dismiss/cancel if False.
TYPE:
|
prompt_text
|
Text for prompt dialogs (ignored for alert/confirm).
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
NoDialogPresent
|
If no dialog is currently displayed. |
Note
Page events must be enabled to handle dialogs.
execute_script
async
execute_script(script, *, object_group=None, include_command_line_api=None, silent=None, context_id=None, return_by_value=None, generate_preview=None, user_gesture=None, await_promise=None, throw_on_side_effect=None, timeout=None, disable_breaks=None, repl_mode=None, allow_unsafe_eval_blocked_by_csp=None, unique_context_id=None, serialization_options=None)
Execute JavaScript in page context.
| PARAMETER | DESCRIPTION |
|---|---|
script
|
JavaScript code to execute.
TYPE:
|
object_group
|
Symbolic group name for the result (Runtime.evaluate).
TYPE:
|
include_command_line_api
|
Whether to include command line API (Runtime.evaluate).
TYPE:
|
silent
|
Whether to silence exceptions (Runtime.evaluate).
TYPE:
|
context_id
|
ID of the execution context to evaluate in (Runtime.evaluate).
TYPE:
|
return_by_value
|
Whether to return the result by value instead of reference (Runtime.evaluate).
TYPE:
|
generate_preview
|
Whether to generate a preview for the result (Runtime.evaluate).
TYPE:
|
user_gesture
|
Whether to treat evaluation as initiated by user gesture (Runtime.evaluate).
TYPE:
|
await_promise
|
Whether to await promise result (Runtime.evaluate).
TYPE:
|
throw_on_side_effect
|
Whether to throw if side effect cannot be ruled out (Runtime.evaluate).
TYPE:
|
timeout
|
Timeout in milliseconds (Runtime.evaluate).
TYPE:
|
disable_breaks
|
Whether to disable breakpoints during evaluation (Runtime.evaluate).
TYPE:
|
repl_mode
|
Whether to execute in REPL mode (Runtime.evaluate).
TYPE:
|
allow_unsafe_eval_blocked_by_csp
|
Allow unsafe evaluation (Runtime.evaluate).
TYPE:
|
unique_context_id
|
Unique context ID for evaluation (Runtime.evaluate).
TYPE:
|
serialization_options
|
Serialization options for the result (Runtime.evaluate).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
EvaluateResponse
|
The result of the script execution.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
InvalidScriptWithElement
|
If the script references |
Examples:
Execute a simple script to log a message
await tab.execute_script('console.log("Hello World")')
Execute a script that returns the page title
await tab.execute_script('return document.title')
continue_request
async
continue_request(request_id, url=None, method=None, post_data=None, headers=None, intercept_response=None)
Continue paused request without modifications.
fulfill_request
async
Fulfill request with response data.
continue_with_auth
async
Continue a paused request replying to an authentication challenge.
Useful for proxy auth (407) or server auth (401) when Fetch is enabled with handle_auth=True.
expect_file_chooser
async
Context manager for automatic file upload handling.
| PARAMETER | DESCRIPTION |
|---|---|
files
|
File path(s) for upload.
TYPE:
|
expect_cloudflare_turnstile
async
Handle the Cloudflare Turnstile widget if it appears while the block runs.
| PARAMETER | DESCRIPTION |
|---|---|
time_to_wait_captcha
|
Timeout for captcha detection (default 5s).
TYPE:
|
expect_download
async
Context manager for handling a file download triggered inside the block.
Behavior: - If keep_file_at is provided, configure browser to save into that directory and keep file. - Otherwise, a temporary directory is used and cleaned up after the context.
| PARAMETER | DESCRIPTION |
|---|---|
keep_file_at
|
Directory to persist the file. If None, uses a temporary directory and cleans it up afterwards.
TYPE:
|
timeout
|
Max seconds to wait for download completion. Defaults to 60.
TYPE:
|
| YIELDS | DESCRIPTION |
|---|---|
DownloadHandle
|
Handle to read the downloaded file (bytes/base64) and check its path.
TYPE::
|
on
async
Register CDP event listener.
Callback runs in background task to prevent blocking.
| PARAMETER | DESCRIPTION |
|---|---|
event_name
|
CDP event name (e.g., 'Page.loadEventFired').
|
callback
|
Function called on event (sync or async).
|
temporary
|
Remove after first invocation.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Callback ID for removal. |
Note
Corresponding domain must be enabled before events fire.
find
async
find(id: str | None = ..., class_name: str | None = ..., name: str | None = ..., tag_name: str | None = ..., text: str | None = ..., timeout: int = ..., find_all: Literal[False] = False, raise_exc: Literal[True] = True, **attributes) -> WebElement
find(id: str | None = ..., class_name: str | None = ..., name: str | None = ..., tag_name: str | None = ..., text: str | None = ..., timeout: int = ..., find_all: Literal[False] = False, raise_exc: Literal[False] = False, **attributes) -> WebElement | None
find(id: str | None = ..., class_name: str | None = ..., name: str | None = ..., tag_name: str | None = ..., text: str | None = ..., timeout: int = ..., find_all: Literal[True] = True, raise_exc: Literal[True] = True, **attributes) -> list[WebElement]
find(id: str | None = ..., class_name: str | None = ..., name: str | None = ..., tag_name: str | None = ..., text: str | None = ..., timeout: int = ..., find_all: Literal[True] = True, raise_exc: Literal[False] = False, **attributes) -> list[WebElement] | None
find(id: str | None = ..., class_name: str | None = ..., name: str | None = ..., tag_name: str | None = ..., text: str | None = ..., timeout: int = ..., find_all: bool = ..., raise_exc: bool = ..., **attributes) -> WebElement | list[WebElement] | None
find(id=None, class_name=None, name=None, tag_name=None, text=None, timeout=0, find_all=False, raise_exc=True, **attributes)
Find element(s) using combination of common HTML attributes.
Flexible element location using standard attributes. Multiple attributes can be combined for specific selectors (builds XPath when multiple specified).
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Element ID attribute value.
TYPE:
|
class_name
|
CSS class name to match.
TYPE:
|
name
|
Element name attribute value.
TYPE:
|
tag_name
|
HTML tag name (e.g., "div", "input").
TYPE:
|
text
|
Text content to match within element.
TYPE:
|
timeout
|
Maximum seconds to wait for elements to appear.
TYPE:
|
find_all
|
If True, returns all matches; if False, first match only.
TYPE:
|
raise_exc
|
Whether to raise exception if no elements found.
TYPE:
|
**attributes
|
Additional HTML attributes to match.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
WebElement | list[WebElement] | None
|
WebElement, list[WebElement], or None based on find_all and raise_exc. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If no search criteria provided. |
ElementNotFound
|
If no elements found and raise_exc=True. |
WaitElementTimeout
|
If timeout specified and no elements appear in time. |
NotImplementedError
|
If called on a ShadowRoot (use query() with CSS instead). |
query
async
query(expression: str, timeout: int = ..., find_all: Literal[False] = False, raise_exc: Literal[True] = True) -> WebElement
query(expression: str, timeout: int = ..., find_all: Literal[False] = False, raise_exc: Literal[False] = False) -> WebElement | None
query(expression: str, timeout: int = ..., find_all: Literal[True] = True, raise_exc: Literal[True] = True) -> list[WebElement]
query(expression: str, timeout: int = ..., find_all: Literal[True] = True, raise_exc: Literal[False] = False) -> list[WebElement] | None
query(expression: str, timeout: int = ..., find_all: bool = ..., raise_exc: bool = ...) -> WebElement | list[WebElement] | None
Find element(s) using raw CSS selector or XPath expression.
Direct access using CSS or XPath syntax. Selector type automatically determined based on expression pattern.
| PARAMETER | DESCRIPTION |
|---|---|
expression
|
Selector expression (CSS, XPath, ID with #, class with .).
TYPE:
|
timeout
|
Maximum seconds to wait for elements to appear.
TYPE:
|
find_all
|
If True, returns all matches; if False, first match only.
TYPE:
|
raise_exc
|
Whether to raise exception if no elements found.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
WebElement | list[WebElement] | None
|
WebElement, list[WebElement], or None based on find_all and raise_exc. |
| RAISES | DESCRIPTION |
|---|---|
ElementNotFound
|
If no elements found and raise_exc=True. |
WaitElementTimeout
|
If timeout specified and no elements appear in time. |
NotImplementedError
|
If called with XPath on a ShadowRoot. |
query_script
async
Run a JavaScript function that returns elements and wrap them as WebElements.
The function runs with the search root bound to this (document on a
Tab, the frame document on an iframe element, the element itself on a
WebElement, the root on a ShadowRoot) in the same execution context and
iframe routing that query() uses. It may return a single Element, a
NodeList, an array of Elements, or null.
| PARAMETER | DESCRIPTION |
|---|---|
function_declaration
|
JavaScript function source, e.g.
TYPE:
|
arguments
|
CDP call arguments passed positionally to the function.
TYPE:
|
execution_context_id
|
Run in this execution context of the frame (for
example an isolated world created with
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[WebElement]
|
WebElements for every element the function returned, in return order. |
| RAISES | DESCRIPTION |
|---|---|
ScriptException
|
If the function throws or fails to compile. |
CommandFailed
|
If the browser rejects the command itself. |
execute_command
async
Send a raw CDP command through this object's session.
The command is routed exactly like the object's own operations: a Tab
sends it to the page session, a WebElement inside an out-of-process
iframe sends it to that frame's session. Build commands with the
factories in pydoll.commands or pass a plain {'method': ..., 'params': ...}
dict for methods pydoll does not wrap.
| PARAMETER | DESCRIPTION |
|---|---|
command
|
CDP command to send.
TYPE:
|
timeout
|
Seconds to wait for the browser's answer.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
T_CommandResponse
|
The browser's response, with the domain result under |
| RAISES | DESCRIPTION |
|---|---|
CommandFailed
|
If the browser answers with an error. |
CommandExecutionTimeout
|
If no answer arrives within |