BrowserOperator API Reference
April 2, 2026 · View on GitHub
T
T = TypeVar("T", bound=BaseModel)
ERROR_ACT_START_FAIL
ERROR_ACT_START_FAIL = 9000
ERROR_ACT_TASK_FAILED
ERROR_ACT_TASK_FAILED = 9001
ERROR_ACT_TIMEOUT
ERROR_ACT_TIMEOUT = 9002
ERROR_OBSERVE_FAIL
ERROR_OBSERVE_FAIL = 9020
ERROR_EXTRACT_FAIL
ERROR_EXTRACT_FAIL = 9040
ERROR_EXTRACT_START_FAIL
ERROR_EXTRACT_START_FAIL = 9041
ERROR_EXTRACT_TIMEOUT
ERROR_EXTRACT_TIMEOUT = 9042
BrowserOperator
class BrowserOperator(BaseService)
BrowserOperator handles browser automation and small parts of agentic logic.
⚠️ Note: Currently, for agent services (including ComputerUseAgent, BrowserUseAgent, and MobileUseAgent), we do not provide services for overseas users registered with alibabacloud.com.
init
def __init__(self, session, browser)
navigate
def navigate(url: str) -> str
Navigates a specific page to the given URL.
Arguments:
url: The URL to navigate to.
Returns:
A string indicating the result of the navigation.
screenshot
def screenshot(page=None,
full_page: bool = True,
quality: int = 80,
clip: Optional[Dict[str, float]] = None,
timeout: Optional[int] = None) -> str
Synchronously takes a screenshot of the specified page.
Arguments:
pageOptional[Page] - The Playwright Page object to take a screenshot of. If None, the operator's currently focused page will be used.full_pagebool - Whether to capture the full scrollable page.qualityint - The quality of the image (0-100), for JPEG format.clipOptional[Dict[str, float]] - An object specifying the clipping region {x, y, width, height}.timeoutOptional[int] - Custom timeout for the operation in seconds.
Returns:
str: A base64 encoded data URL of the screenshot, or an error message.
close
def close() -> bool
Synchronously closes the remote browser operator session. This will terminate the browser process managed by the operator.
act
def act(action_input: Union[ObserveResult, ActOptions],
page=None) -> "ActResult"
Synchronously perform an action on a web page.
Arguments:
pageOptional[Page] - The Playwright Page object to act on. If None, the operator's currently focused page will be used automatically.action_inputUnion[ObserveResult, ActOptions] - The action to perform.
Returns:
ActResult: The result of the action.
observe
def observe(options: ObserveOptions,
page=None) -> Tuple[bool, List[ObserveResult]]
Synchronously observe elements or state on a web page.
Arguments:
pageOptional[Page] - The Playwright Page object to observe. If None, the operator's currently focused page will be used.optionsObserveOptions - Options to configure the observation behavior.
Returns:
Tuple[bool, List[ObserveResult]]: A tuple containing a success boolean and a list of observation results.
extract
def extract(options: ExtractOptions, page=None) -> Tuple[bool, T]
Synchronously extract information from a web page.
Arguments:
pageOptional[Page] - The Playwright Page object to extract from. If None, the operator's currently focused page will be used.optionsExtractOptions - Options to configure the extraction, including schema.
Returns:
Tuple[bool, T]: A tuple containing a success boolean and the extracted data as a Pydantic model instance, or None on failure.
login
def login(login_config: str,
page=None,
use_vision: Optional[bool] = False) -> "ActResult"
Synchronously perform a login operation on a web page.
Arguments:
login_configstr - A JSON string containing login configuration, e.g., '{"api_key": "xxx", "skill_id": "yyy"}'pageOptional[Page] - The Playwright Page object to login on. If None, the agent's currently focused page will be used.use_visionOptional[bool] - Whether to use vision-based capabilities during login.
Returns:
ActResult: The result of the login operation.
See Also
Documentation generated automatically from source code using pydoc-markdown.