DocsPage Interactionbrowser_type

browser_type

Browser Type

Type text into an input field with human-like keystroke simulation. Target the field using CSS selector, coordinates, or natural language (e.g., 'email field'). When selector is omitted, types into the currently focused element. Note: Does NOT clear existing content - use browser_clear_input first if you need to replace text rather than append.

Usage Example

123456789101112
import asyncio
from owl_browser import OwlBrowser, RemoteConfig
# Async usage
async with OwlBrowser(config) as browser:
context = await browser.create_context()
context_id = context["context_id"]
await browser.type(
context_id=context_id,
text="value"
)

Parameters

Required

context_idstringrequired

The unique identifier of the browser context (e.g., 'ctx_000001')

textstringrequired

The text to type into the input field. Simulates real keystrokes with human-like timing. Existing content is NOT cleared - use browser_clear_input first if needed

Optional

selectorstring

Target input field. Accepts: CSS selector (e.g., '#email', 'input[name="username"]'), XY coordinates (e.g., '100x200'), or natural language description (e.g., 'email field', 'search box'). When omitted, types into the currently focused element (document.activeElement)

indexstring

When multiple elements match the selector, target the Nth element (0-based). Uses querySelectorAll()[index] instead of querySelector(). Default: -1 (first match)

Response

Returns a JSON object with the operation result.

{
  "success": true,
  "result": <value>
}