<!-- BusyBot node reference — https://busybot.net/tools/html/ -->

> Node: HTML (`html`) · Action (binary) · v1
> Category: Core Nodes · Credentials: none
> Updated: 2026-08-16

# HTML

> Generate HTML templates, extract HTML content, or convert JSON to HTML tables

## Overview

The HTML tool provides three operations: (1) generateHtmlTemplate — takes an HTML template with {{ expression }} placeholders, resolves them against the input item data context, and outputs the rendered HTML as JSON or optionally as a binary .html file; (2) extractHtmlContent — parses HTML from a JSON property or binary data field and extracts values using CSS selectors (supports text, html, attribute, and value extraction with array/single return modes); (3) convertToHtmlTable — aggregates all input items into a single HTML table element with configurable styling, headers, captions, and attributes. No external API credentials required.

**Category:** Core Nodes  
**Tool Name:** `html`  
**Version:** 1

**Appearance:** Icon: `lucide-Code` | Color: `#E34F26`

## Node Type

**Action (Binary)** — handles file/binary data operations

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool does not require any credentials.

### Operations

| Operation | Value | Description |
|-----------|-------|-------------|
| Generate HTML Template | `generateHtmlTemplate` | Render an HTML template with expression placeholders resolved against item data |
| Extract HTML Content | `extractHtmlContent` | Extract values from HTML using CSS selectors |
| Convert to HTML Table | `convertToHtmlTable` | Aggregate all input items into a single HTML table |

### Parameters

#### Generate HTML Template (`generateHtmlTemplate`)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| HTML Template | `string` | No | A skeleton HTML document | HTML template with {{ expression }} placeholders. Expressions are evaluated against the current item data context. Use {{ $json.fieldName }} to reference input fields. |
| Output as Binary | `boolean` | No | `false` | Whether to output the rendered HTML as a binary .html file instead of a JSON property. |
| Binary Property | `string` | No | `data` | Name of the binary property to write the HTML file to. Names are case-sensitive — see the upstream node's Binary Data panel for the exact names to use. _(shown when Output as Binary is `true`)_ |
| File Name | `string` | No | `output.html` | File name for the binary HTML output. _(shown when Output as Binary is `true`)_ |

#### Extract HTML Content (`extractHtmlContent`)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Source Data | `options` | No | `json` | Whether HTML should be read from binary data or a JSON property. |
| | | | | Options: `binary` (read HTML from a binary data property), `json` (read HTML from a JSON property on the item) |
| Input Binary Field | `string` | Yes | `data` | The name of the input binary field containing the HTML file to be extracted. _(shown when Source Data is `binary`)_ |
| JSON Property | `string` | Yes | `data` | Name of the JSON property containing the HTML to extract data from. Supports dot-notation (e.g., "response.body"). Can be a string or array of strings. _(shown when Source Data is `json`)_ |
| Extraction Values | `fixedCollection` | No | One empty rule | Define one or more extraction rules. Each rule uses a CSS selector to find elements and extracts the specified data. |
| — Key | `string` | No | — | The key under which the extracted value should be saved in the output JSON. |
| — CSS Selector | `string` | No | — | The CSS selector to match HTML elements (e.g., "h1", ".price", "#main a", "table tr td:nth-child(2)"). |
| — Return Value | `options` | No | `text` | What kind of data should be returned from matched elements. |
| | | | | Options: `attribute` (get an attribute value like "class" from an element), `html` (get the inner HTML the element contains), `text` (get only the text content of the element), `value` (get value of an input, select, or textarea element) |
| — Attribute | `string` | No | — | The name of the attribute to return the value of (e.g., "href", "src", "data-id"). _(shown when Return Value is `attribute`)_ |
| — Skip Selectors | `string` | No | — | Comma-separated list of selectors for elements to skip/remove during text extraction. _(shown when Return Value is `text`)_ |
| — Return Array | `boolean` | No | `false` | Whether to return values as an array. If true, each matched element produces a separate array entry. If false, all matched text is concatenated into a single string. |
| Options (`options`) | `collection` | No | `{}` | Whitespace handling for extracted values. |
| — Trim Values | `boolean` | No | `true` | Whether to automatically remove spaces and newlines from the beginning and end of extracted values. |
| — Clean Up Text | `boolean` | No | `true` | Whether to remove leading/trailing whitespace, line breaks, and condense multiple consecutive whitespaces into a single space. |

#### Convert to HTML Table (`convertToHtmlTable`)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Options (`tableOptions`) | `collection` | No | `{}` | Styling and formatting for the generated table. |
| — Capitalize Headers | `boolean` | No | `false` | Whether to capitalize header names by splitting on underscores (e.g., "first_name" becomes "First Name"). |
| — Custom Styling | `boolean` | No | `false` | When true, no default inline styles are applied. When false, applies built-in styles for a clean default appearance. |
| — Caption | `string` | No | — | Optional caption text for the table. |
| — Table Attributes | `string` | No | — | Raw HTML attributes to add to the table element. |
| — Header Attributes | `string` | No | — | Raw HTML attributes to add to the thead element. |
| — Row Attributes | `string` | No | — | Raw HTML attributes to add to each tr element. |
| — Cell Attributes | `string` | No | — | Raw HTML attributes to add to each td element. |

#### All Operations

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Max Concurrency | `number` | No | `10` | Maximum number of items to process concurrently. |

## Output Data

### Generate HTML Template

One output item per input item. The rendered markup is written to `html`:

```json
{
  "html": "<h1>Hello Ada!</h1><p>Your email is ada@example.com</p>"
}
```

With **Output as Binary** off, `html` is the only field on the item — the rest of the input JSON is dropped. With **Output as Binary** on, the input JSON is kept, `html` is added beside it, and the same markup is also written as a `text/html` binary file on **Binary Property** under **File Name**, alongside any binary the item already carried.

### Extract HTML Content

One output item per HTML string parsed. The extracted values are **added to** the input item's JSON, each under its rule's **Key**:

```json
{
  "url": "https://example.com/article",
  "headline": "Quarterly results",
  "links": ["https://example.com/a", "https://example.com/b"],
  "tags": ["finance", "reports"]
}
```

- A rule with **Return Array** on gives an array with one entry per matched element; with it off, a single value.
- A selector that matches nothing yields an empty array when **Return Array** is on, and an empty value when it is off — extraction never fails just because the page changed shape.
- When **JSON Property** points at an array of HTML strings, the node emits one output item per string, so a page-per-string crawl fans out automatically.
- Binary data is forwarded unchanged.

### Convert to HTML Table

**One output item for the whole node run**, whatever the input count. The item JSON holds a single field:

```json
{
  "table": "<table ...><thead>…</thead><tbody>…</tbody></table>"
}
```

The column headers are the union of the keys found on the input items, and nothing from the input JSON is carried onto the output item. No binary is produced — pass the result to Convert to File if you need a downloadable `.html`.

## Usage Examples

- Generate an HTML email template with dynamic data
- Convert workflow results to a styled HTML table
- Extract titles and links from an HTML page using CSS selectors
- Create an HTML report as a downloadable .html file
- Parse HTML from a binary file and extract structured data

## Example Configuration

Render a simple template from item fields:

```json
{
  "type": "html",
  "parameters": {
    "operation": "generateHtmlTemplate",
    "html": "<h1>Hello {{ $json.name }}!</h1><p>Your email is {{ $json.email }}</p>",
    "maxConcurrency": 10
  }
}
```

Render a full document and save it as a downloadable file:

```json
{
  "type": "html",
  "parameters": {
    "operation": "generateHtmlTemplate",
    "html": "<!DOCTYPE html><html><head><title>{{ $json.title }}</title></head><body><h1>{{ $json.heading }}</h1><p>{{ $json.content }}</p></body></html>",
    "outputAsBinary": true,
    "binaryPropertyName": "htmlDocument",
    "fileName": "report.html",
    "maxConcurrency": 5
  }
}
```

Extract a title, every link and the paragraph text from an HTML string on the item:

```json
{
  "type": "html",
  "parameters": {
    "operation": "extractHtmlContent",
    "sourceData": "json",
    "dataPropertyName": "htmlContent",
    "extractionValues": {
      "values": [
        {
          "key": "title",
          "cssSelector": "h1",
          "returnValue": "text",
          "returnArray": false
        },
        {
          "key": "links",
          "cssSelector": "a",
          "returnValue": "attribute",
          "attribute": "href",
          "returnArray": true
        },
        {
          "key": "paragraphs",
          "cssSelector": "p",
          "returnValue": "text",
          "skipSelectors": ".exclude",
          "returnArray": true
        }
      ]
    },
    "options": {
      "trimValues": true,
      "cleanUpText": true
    }
  }
}
```

Extract from an uploaded HTML file instead:

```json
{
  "type": "html",
  "parameters": {
    "operation": "extractHtmlContent",
    "sourceData": "binary",
    "dataPropertyName": "uploadedFile",
    "extractionValues": {
      "values": [
        {
          "key": "productName",
          "cssSelector": ".product-title",
          "returnValue": "text",
          "returnArray": false
        },
        {
          "key": "price",
          "cssSelector": ".price",
          "returnValue": "text",
          "returnArray": false
        }
      ]
    },
    "options": {
      "trimValues": true,
      "cleanUpText": false
    },
    "maxConcurrency": 3
  }
}
```

Scrape several fields out of a fetched page body:

```json
{
  "type": "html",
  "parameters": {
    "operation": "extractHtmlContent",
    "sourceData": "json",
    "dataPropertyName": "response.body",
    "extractionValues": {
      "values": [
        {
          "key": "headline",
          "cssSelector": "h1.main-title",
          "returnValue": "text",
          "returnArray": false
        },
        {
          "key": "publishDate",
          "cssSelector": ".publish-date",
          "returnValue": "attribute",
          "attribute": "datetime",
          "returnArray": false
        },
        {
          "key": "tags",
          "cssSelector": ".tag",
          "returnValue": "text",
          "returnArray": true
        },
        {
          "key": "content",
          "cssSelector": ".article-body",
          "returnValue": "html",
          "skipSelectors": ".advertisement, .related-links",
          "returnArray": false
        }
      ]
    },
    "options": {
      "trimValues": true,
      "cleanUpText": true
    }
  }
}
```

Build a fully styled table from every input item:

```json
{
  "type": "html",
  "parameters": {
    "operation": "convertToHtmlTable",
    "tableOptions": {
      "capitalize": true,
      "customStyling": true,
      "caption": "Sales Report",
      "tableAttributes": "class=\"data-table\" id=\"sales\"",
      "headerAttributes": "class=\"table-header\"",
      "rowAttributes": "class=\"table-row\"",
      "cellAttributes": "class=\"table-cell\""
    },
    "maxConcurrency": 1
  }
}
```

Build a table with the built-in default styling:

```json
{
  "type": "html",
  "parameters": {
    "operation": "convertToHtmlTable",
    "tableOptions": {
      "capitalize": false,
      "customStyling": false
    }
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Generate HTML from templates, extract data from HTML with CSS selectors, or convert JSON to HTML tables -- optionally outputting as binary .html files.

### Common Patterns

- **Dynamic email templates** — render personalised HTML per item with `{{ $json.firstName }}`-style placeholders, then hand the result to an email node.
- **Web scraping** — chain HTTP Request into Extract HTML Content, pointing **JSON Property** at the response body and defining one extraction rule per field you want.
- **Data reports** — feed a query result into Convert to HTML Table with **Capitalize Headers** on for a presentable report.

### Parameter Dependencies

- **Generate HTML Template**: **Output as Binary**, **Binary Property** and **File Name** work together for file output.
- **Extract HTML Content**: **Source Data** decides whether **Input Binary Field** or **JSON Property** is used; **Extraction Values** defines what to extract; Options refines whitespace handling.
- **Convert to HTML Table**: everything is optional and only affects styling.

### Notes

- **HTML Template** takes platform expressions only — `{{ $json.field }}` and the like. Templating-language constructs such as loops or conditionals are not evaluated and will appear literally in the output.
- `text` extraction concatenates the text of every matched element unless **Return Array** is on. When a selector can match more than one element, turn **Return Array** on to keep the values separate.
- **Skip Selectors** removes matching child elements before text is read, which is the cleanest way to drop adverts and navigation from an article body.