Setup
bl find
Find elements by CSS selector or semantic locator
Find elements by CSS selector or semantic locator
Usage
bl find [selector...] [OPTIONS]
bl find <command>Arguments
| Argument | Description |
|---|---|
[selector...] | CSS selector (optionally preceded by a URL to navigate first) |
Options
| Option | Description |
|---|---|
--all | Find all matching elements |
--limit <value> | Maximum number of elements to return (with --all) (default 10) |
--nth <value> | Select the 0-based Nth match of the selector (default: first). Mutually exclusive with --last. |
--last | Select the last match of the selector. Mutually exclusive with --nth. |
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl find "a"
# → @e1 [a] "More information..." @ (32,133) 140x18
bl find ".item" --nth 2
# → @e1 [div] "Third item" @ (16,220) 320x40 (0-based)
bl find ".item" --last
# → @e1 [div] "Last item" @ (16,900) 320x40
bl find "a" --all
# → @e1 [a] "Home" @ (16,12) 48x24 @e2 [a] "About" ...
bl find text "Sign In"
# → @e1 [button] "Sign In" @ (312,428) 96x40
bl find role button
# → @e1 [button] "Submit" @ (312,428) 96x40
bl find role heading --name "Example"
# Find heading with accessible name "Example"bl find text
Find element by text content
Usage
bl find text <text> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<text> | Find element by text content |
Options
| Option | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl find text "Sign In"
# → @e1 [button] "Sign In" @ (312,428) 96x40bl find role
Find element by ARIA role
Usage
bl find role <role> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<role> | ARIA role to match |
Options
| Option | Description |
|---|---|
--name <value> | Accessible name filter |
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl find role button
# → @e1 [button] "Submit" @ (312,428) 96x40
bl find role heading --name "Example"
# Find heading with accessible name "Example"bl find label
Find input by associated label text
Usage
bl find label <label> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<label> | Find input by associated label text |
Options
| Option | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl find label "Email"
# → @e1 [input type="email"] placeholder="Email" @ (80,240) 320x36bl find placeholder
Find element by placeholder attribute
Usage
bl find placeholder <placeholder> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<placeholder> | Find element by placeholder attribute |
Options
| Option | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl find placeholder "Search..."
# → @e1 [input] placeholder="Search..." @ (80,240) 320x36bl find testid
Find element by data-testid attribute
Usage
bl find testid <testid> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<testid> | Find element by data-testid attribute |
Options
| Option | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl find testid "submit-btn"
# → @e1 [button] data-testid="submit-btn" @ (312,428) 96x40bl find xpath
Find element by XPath expression
Usage
bl find xpath <expression> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<expression> | Find element by XPath expression |
Options
| Option | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl find xpath "//div[@class='main']"
# → @e1 [div] "..." @ (0,64) 960x480bl find alt
Find element by alt attribute
Usage
bl find alt <alt> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<alt> | Find element by alt attribute |
Options
| Option | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl find alt "Logo"bl find title
Find element by title attribute
Usage
bl find title <title> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<title> | Find element by title attribute |
Options
| Option | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl find title "Close"