Setup
bl attr
Get an HTML attribute value from an element
Get an HTML attribute value from an element
Usage
bl attr <selector> <attribute> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<selector> | CSS selector for the element |
<attribute> | Attribute name to read (e.g. href, src) |
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 attr "a" "href"
# Get the href of the first link
bl attr "img" "src"
# Get the image source URL