Type identifier:
text:html:queryAndTransformCategory: Text Operations
The Text HTML Query and Transform node manipulates HTML through a sequence of configurable operations. It can query elements using CSS selectors to extract content (HTML, text, or attributes) and remove unwanted elements from the document. Each query operation creates a dynamic output handle for its results.
Handle | Type | Description |
|---|---|---|
|
| The HTML document to query and transform. |
Handle | Type | Description |
|---|---|---|
|
| The transformed HTML document after all operations. |
| varies | Dynamic handles for each query operation (see Operations). |
The node supports a list of operations executed in sequence:
Extracts content from elements matching a CSS selector.
Field | Type | Default | Description |
|---|---|---|---|
Selector |
| - | CSS selector to match elements. |
Match All |
|
| If true, matches all elements; if false, matches only the first. |
Output Type |
|
| Format of extracted content. |
Attributes |
| - | When Output Type is "attributes", specifies which attributes to extract. |
Output handle type varies based on configuration:
html output: string or string[] (if Match All)text output: string or string[] (if Match All)attributes output: object or object[] with requested attribute keysRemoves elements matching a CSS selector from the document.
Field | Type | Default | Description |
|---|---|---|---|
Selector |
| - | CSS selector for elements to remove. |
Match All |
|
| If true, removes all matching elements. |
Executes operations in sequence:
result handleUses standard CSS selector syntax:
p, div, span.class-name#element-id[attr], [attr=value]>, +, ~, (descendant):first-child, :last-childOutput Type | Description | Example Output |
|---|---|---|
| Full HTML including tags |
|
| Text content only |
|
| Specified attribute values |
|
Operations:
article h1, Output Type text — the titlearticle p, Output Type html — the paragraphsscript, style, navInput:
<html>
<nav>Menu</nav>
<article>
<h1>Article Title</h1>
<p>First paragraph.</p>
<p>Second paragraph.</p>
</article>
<script>
console.log("removed");
</script>
</html>Outputs:
"Article Title"["<p>First paragraph.</p>", "<p>Second paragraph.</p>"]Operations:
a, Attributes ["href", "title"], Output Type attributesInput:
<p>Visit <a href="https://example.com" title="Example">our site</a>.</p>Output:
[{ "href": "https://example.com", "title": "Example" }]Operations:
noscript, script, style, [hidden], [aria-hidden], link, svgUse case: Preparing HTML for text extraction or AI processing.