Skip to main content

Overview

Inspection commands allow you to extract information from elements and check their state.

Get Element Information

get text

Get text content of an element.
ParameterDescription
selectorElement selector
Examples:
agent-browser get text @e1
agent-browser get text "#username"
agent-browser get text ".error-message"
Output:
Welcome to Example Domain

get html

Get innerHTML of an element.
ParameterDescription
selectorElement selector
Examples:
agent-browser get html @e2
agent-browser get html "#content"
Output:
<p>This is <strong>example</strong> content.</p>

get value

Get value of an input element.
ParameterDescription
selectorInput element selector
Examples:
agent-browser get value @e3
agent-browser get value "#email"
Output:

get attr

Get attribute value of an element.
ParameterDescription
selectorElement selector
attributeAttribute name
Examples:
agent-browser get attr @e4 href
agent-browser get attr "#logo" src
agent-browser get attr "button" data-id
Output:
https://example.com/page

get title

Get page title. Examples:
agent-browser get title
Output:
Example Domain

get url

Get current page URL. Examples:
agent-browser get url
Output:
https://example.com/page

get count

Count matching elements.
ParameterDescription
selectorElement selector
Examples:
agent-browser get count ".item"
agent-browser get count "button"
Output:
5

get box

Get bounding box of an element.
ParameterDescription
selectorElement selector
Examples:
agent-browser get box @e1
agent-browser get box "#header"
Output:
{"x": 10, "y": 20, "width": 300, "height": 50}

get styles

Get computed styles of an element.
ParameterDescription
selectorElement selector
Examples:
agent-browser get styles @e2
agent-browser get styles ".button"
Output:
{"display": "block", "color": "rgb(0, 0, 0)", ...}

Check Element State

is visible

Check if element is visible.
ParameterDescription
selectorElement selector
Examples:
agent-browser is visible @e1
agent-browser is visible "#modal"
Output:
true

is enabled

Check if element is enabled.
ParameterDescription
selectorElement selector
Examples:
agent-browser is enabled @e2
agent-browser is enabled "#submit-button"
Output:
false

is checked

Check if checkbox or radio is checked.
ParameterDescription
selectorCheckbox/radio selector
Examples:
agent-browser is checked @e3
agent-browser is checked "#agree-terms"
Output:
true

Workflow Examples

Verify Form Submission

# Submit form
agent-browser click @e5

# Wait for success message
agent-browser wait @e6

# Verify message text
agent-browser get text @e6
# Output: "Form submitted successfully"

# Verify URL changed
agent-browser get url
# Output: https://example.com/success

Extract Data

# Get page title
agent-browser get title

# Count all links
agent-browser get count "a"

# Extract all product names
agent-browser get text ".product-name"

# Get current URL
agent-browser get url

Conditional Logic

# Check if error is visible
agent-browser is visible ".error"

# If visible, get error message
agent-browser get text ".error"

# Check if button is enabled
agent-browser is enabled "#submit"

# Check if checkbox is checked
agent-browser is checked "#newsletter"

JSON Output for Agents

# Get text in JSON format
agent-browser get text @e1 --json
# {"success":true,"data":"Welcome to Example Domain"}

# Check visibility in JSON format
agent-browser is visible @e2 --json
# {"success":true,"data":true}

# Get count in JSON format
agent-browser get count ".item" --json
# {"success":true,"data":5}

Build docs developers (and LLMs) love