data field into a JSON tree shaped like { tag, attributes, children }. Use it after HTTP or browser steps that produce HTML, then chain JSONata (1022) to extract the fields you need.
Overview
The HTML Parse command provides functionality for:- Turning raw HTML strings into a stable JSON DOM representation
- Preserving element tags, attributes, and nested structure
- Representing text nodes as
{ tag: "#text", text: "..." } - Handling single-root HTML, multiple roots, and mixed text + elements
Command Type
Command ID: 1024Command type: PARSE
Parameters
This command has no configurable parameters. The previous step must leavedata as a string containing HTML (for example an HTTP response body or browser outerHTML).
Input and output
Input:data must be a string. If data is already an object or array, the command fails.
Output: data is replaced by the DOM tree (unless a downstream command uses a different output key).
Root shaping:
Example tree (simplified):
Usage Examples
Parse HTML from the previous step
Add HTML Parse (1024) with empty params after a step that setsdata to an HTML string:
Chain with JSONata to extract a value
After HTML Parse, add JSONata (1022). Expressions usedata as the tree root:
Collect all text nodes
Common Use Cases
- Sportsbook / market HTML: Parse list markup from a fetch or browser step, then JSONata into a flat list of odds or selections
- Legacy HTML pages: Avoid fragile regex on raw HTML; query the tree with JSONata
- Browser scraping: Parse
outerHTMLor a fragment returned from Run Custom Code