Setup

bl html

Get HTML content of the page or an element

Get HTML content of the page or an element

Usage

bl html [args...] [OPTIONS]

Arguments

ArgumentDescription
[args...]CSS selector, or a URL to navigate to first (optionally followed by a selector)

Options

OptionDescription
--outerReturn outerHTML instead of innerHTML
--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 html
# Get full page HTML

bl html "div.content"
# Get innerHTML of a specific element

bl html "div.content" --outer
# Get outerHTML of a specific element

bl html https://example.com "h1"
# Navigate then get element HTML

On this page