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

ArgumentDescription
&lt;selector&gt;CSS selector for the element
&lt;attribute&gt;Attribute name to read (e.g. href, src)

Options

OptionDescription
--headlessHide browser window (visible by default)
--jsonOutput as JSON
--session <value>Run this command in the named session (env: BL_SESSION; default: "default")

Global options

OptionDescription
-v, --verboseEnable debug logging

Examples

bl attr "a" "href"
# Get the href of the first link

bl attr "img" "src"
# Get the image source URL

On this page