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
| Argument | Description |
|---|---|
[args...] | CSS selector, or a URL to navigate to first (optionally followed by a selector) |
Options
| Option | Description |
|---|---|
--outer | Return outerHTML instead of innerHTML |
--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 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