Skip to content

Bedrock Agentcore  >  Operations  >  invoke_browser

invoke_browser

Operation

invoke_browser async

invoke_browser(input: InvokeBrowserInput, plugins: list[Plugin] | None = None) -> InvokeBrowserOutput

Invokes an operating system-level action on a browser session in Amazon Bedrock AgentCore. This operation provides direct OS-level control over browser sessions, enabling mouse actions, keyboard input, and screenshots that the WebSocket-based Chrome DevTools Protocol (CDP) cannot handle --- such as interacting with print dialogs, context menus, and JavaScript alerts.

You send a request with exactly one action in the BrowserAction union, and receive a corresponding result in the BrowserActionResult union.

The following operations are related to InvokeBrowser:

Parameters:

Name Type Description Default
input InvokeBrowserInput

An instance of InvokeBrowserInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
InvokeBrowserOutput

An instance of InvokeBrowserOutput.

Input

InvokeBrowserInput dataclass

Request for the InvokeBrowser operation.

Attributes

action class-attribute instance-attribute
action: BrowserAction | None = None

The browser action to perform. Exactly one member of the BrowserAction union must be set per request.

browser_identifier class-attribute instance-attribute
browser_identifier: str | None = None

The unique identifier of the browser associated with the session. This must match the identifier used when creating the session with StartBrowserSession.

session_id class-attribute instance-attribute
session_id: str | None = None

The unique identifier of the browser session on which to perform the action. This must be an active session created with StartBrowserSession.

Output

InvokeBrowserOutput dataclass

Response for the InvokeBrowser operation.

Attributes

result instance-attribute

The result of the browser action. The member set in the result corresponds to the action that was performed.

session_id instance-attribute
session_id: str

The unique identifier of the browser session on which the action was performed.