CLI referenceInspect page
bl find
Find elements by CSS selector or semantic locator
Find elements by CSS selector or semantic locator
Usage
bl find [selector] [flags]
bl find [command]Flags
| Flag | Description |
|---|---|
--all | Find all matching elements |
--limit int | Maximum number of elements to return (with --all) (default 10) |
Global flags
| Flag | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
-v, --verbose | Enable debug logging |
Examples
bl find "a"
# → @e1 [a] "More information..."
bl find "a" --all
# → @e1 [a] "Home" @e2 [a] "About" ...
bl find text "Sign In"
# → @e1 [button] "Sign In"
bl find role button
# → @e1 [button] "Submit"
bl find role heading --name "Example"
# Find heading with accessible name "Example"bl find alt
Find element by alt attribute
Usage
bl find alt [alt] [flags]Global flags
| Flag | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
-v, --verbose | Enable debug logging |
Examples
bl find alt "Logo"bl find label
Find input by associated label text
Usage
bl find label [label] [flags]Global flags
| Flag | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
-v, --verbose | Enable debug logging |
Examples
bl find label "Email"
# → @e1 [input type="email"] placeholder="Email"bl find placeholder
Find element by placeholder attribute
Usage
bl find placeholder [placeholder] [flags]Global flags
| Flag | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
-v, --verbose | Enable debug logging |
Examples
bl find placeholder "Search..."
# → @e1 [input] placeholder="Search..."bl find role
Find element by ARIA role
Usage
bl find role [role] [flags]Flags
| Flag | Description |
|---|---|
--name string | Accessible name filter |
Global flags
| Flag | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
-v, --verbose | Enable debug logging |
Examples
bl find role button
# → @e1 [button] "Submit"
bl find role heading --name "Example"
# Find heading with accessible name "Example"bl find testid
Find element by data-testid attribute
Usage
bl find testid [testid] [flags]Global flags
| Flag | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
-v, --verbose | Enable debug logging |
Examples
bl find testid "submit-btn"
# → @e1 [button] data-testid="submit-btn"bl find text
Find element by text content
Usage
bl find text [text] [flags]Global flags
| Flag | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
-v, --verbose | Enable debug logging |
Examples
bl find text "Sign In"
# → @e1 [button] "Sign In"bl find title
Find element by title attribute
Usage
bl find title [title] [flags]Global flags
| Flag | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
-v, --verbose | Enable debug logging |
Examples
bl find title "Close"bl find xpath
Find element by XPath expression
Usage
bl find xpath [expression] [flags]Global flags
| Flag | Description |
|---|---|
--headless | Hide browser window (visible by default) |
--json | Output as JSON |
-v, --verbose | Enable debug logging |
Examples
bl find xpath "//div[@class='main']"
# → @e1 [div.main] ...