// guides · n8n error index

n8n HTML Extract not working: empty values, selectors and errors, 32 runs

Fix the n8n HTML node (Extract HTML Content): empty strings on JavaScript-built pages, only the first match returned, "No property named data exists!", XPath "Empty sub-selector", tables, links and encoding. 32 real runs on n8n 2.43.7.

Updated 2026-10-24 · about 10 minutes

Still stuck after these steps? Paste your exact n8n error and we'll reproduce it and email you the fix, free →

Steps

  1. All values empty on a real site? The page is built by JavaScript

    The HTML node only sees the HTML the server sent. No JavaScript runs. On a page with an empty <div id="app"> and its data inside a <script> tag, every key came back as "" and the run was green. To check, look at the raw response of your HTTP Request node: if the text you want is not in it, no selector will find it. Call the JSON API the page itself uses (open the browser DevTools, Network tab), read the JSON embedded in the page, or use a headless-browser scraping service.

  2. Only one result? Turn on Return Array

    A selector that matched 2 elements returned only the first one ("One"), with no warning. With Return Array on, it returned ["One","Two"]. A selector that matched nothing returned "" (or [] with Return Array), again with no error, so an empty value usually means the selector is wrong, not the node.

  3. Fix "No property named ... exists!": match the source

    With Source Data JSON, the node reads the field named in JSON Property (data by default). When the HTML was in data and the field was set to body, it failed with No property named "body" exists!. When the HTTP Request node had saved the page as a file, Source Data JSON failed with No property named "data" exists!; switching Source Data to Binary fixed it. Dot notation such as body.html worked for nested fields, but pointing at the object itself ({data: {html: ...}}) gave "" for every key with a green run.

  4. Check the selector: CSS only, and classes are case-sensitive

    The node uses CSS selectors (cheerio). XPath like //h1 failed with Empty sub-selector, and a broken selector such as div[ failed with Expected name, found . Tag names ignore case (h1 matched <H1>), but class names do not: .big did not match class="Big". Selectors copied from DevTools often assume the wrong nesting: div.p a span found nothing because the span sat next to the link, while .p > .price worked. Extra pseudo-selectors worked too: .p:nth-child(3) a, a:contains('Two') and .price:eq(1).

  5. Getting links, input values or HTML

    For links, set Return Value to Attribute and Attribute to href: we got ["/item/1","https://x.test/item/2"]. Relative links stay relative, so add the site address yourself, for example {{ $json.link.startsWith('http') ? $json.link : 'https://example.com' + $json.link }}. With the Attribute field left empty, the node returned an object with all attributes ({"href":"/item/1"}) instead of a string. Return Value Value read an <input> value ("abc"). Return Value HTML returned the inner HTML of the first match, with entities kept and spaces not trimmed (" Hello &amp; welcome ").

  6. Tables lose their rows

    Extracting tr with Return Array gave ["nv","a1","b2"]: the cells of each row glued together with nothing between them. Extracting td gave one flat list, ["a","1","b","2"], so you can't tell which cell belongs to which row. Two ways out: extract each column separately with td:nth-child(1), td:nth-child(2) and pair them by position, or extract the rows with Return Value HTML and run a second HTML node (or a Code node) on each row.

  7. Your other fields disappear

    With 2 input items the node returned 2 items, one per input, but each held only the extraction keys: the original fields (URL, ID and so on) were gone. Reference them from the earlier node, for example {{ $('HTTP Request').item.json.url }}, or join them back with a Merge node by position.

  8. Odd text: line breaks, uppercase headings, broken accents, input errors

    In HTML node v1.2, line1<br>line2 became "line1\nline2"; the old v1 node gave "line1line2", words glued. Taking the text of a large container such as body returned plain-text style output: headings in capitals (HELLO & WELCOME), links written as One [/item/1], and blank lines between blocks. Use Skip Selectors (we used .ad,table) to leave parts out, or target smaller elements. A Latin-1 page read from a binary file came out as Caf� Zo� with no error, because the bytes are read as UTF-8. Bad input fails with unclear messages: null gave cheerio.load() expects a string and a number gave Cannot create property 'prev' on number '123'. An empty string just returned "".

What we ran

On 24 October 2026 we ran 32 executions on n8n 2.43.7 with n8n execute: a Manual Trigger, a Code node that put a small HTML page into the JSON field data or the binary field data, the HTML node v1.2 with the operation Extract HTML Content (one run on v1), and a No Op node after it.

SetupResult
h1, default optionsHello & welcome: entities decoded, spaces trimmed
Page built by JavaScript (empty <div id="app">, data in a <script>)Every key "", run shows success
Selector matching 2 elements, Return Array offOnly the first match: "One"
Same, Return Array on["One","Two"]
Return Value Attribute, Attribute href, Return Array on["/item/1","https://x.test/item/2"]: relative links stay relative
Return Value Attribute, Attribute field left emptyAn object of all attributes, {"href":"/item/1"}, not a string
Selector that matches nothing"" (Return Array off) or [] (on), no error
JSON Property body, HTML is in dataNo property named "body" exists!
Source Data JSON, HTML is a binary file (HTTP Request with File response)No property named "data" exists!
Same, Source Data BinaryWorks
JSON Property points to an object ({data: {html: ...}})Every key "", run shows success
JSON Property body.html (dot notation)Works
<p>line1<br>line2</p>, HTML node v1.2"line1\nline2"
Same, HTML node v1"line1line2": words glued together
Text of body with Skip Selectors .ad,tableAd and table skipped; headings UPPERCASED (HELLO & WELCOME), links as One [/item/1]
Return Value Value on an <input>"abc"
Return Value HTML on .pInner HTML of the first match
Return Value HTML on h1" Hello &amp; welcome ": entities kept, not trimmed
2 input items2 output items, but only the extraction keys: the original fields are gone
tr with Return Array["nv","a1","b2"]: cells glued with no separator
td with Return Array["a","1","b","2"]: row structure lost
.p:nth-child(3) a, a:contains('Two'), .price:eq(1)All work: Two, Two, $20
XPath //h1Empty sub-selector
Invalid CSS div[Expected name, found
Empty string as input"", no error
null as inputcheerio.load() expects a string
Number 123 as inputCannot create property 'prev' on number '123'
No extraction values definedOutput {"":""}
Empty CSS Selector""
div.p a span (the span is next to the link, not inside it)""; .p > .price works
Upper-case tag <H1>, selector h1Matches: tag names ignore case
class="Big", selector .big"": class names are case-sensitive
Latin-1 page read from binaryCaf� Zo�: broken accents, no error

Quick checklist

Good to know

What we didn't test

FAQ

Why does the n8n HTML node return empty strings?

Most often the page is built by JavaScript, so the text is not in the HTML the server sent, or the selector does not match (class names are case-sensitive). The node raises no error in either case. Check the raw response of the HTTP Request node first.

Why does the n8n HTML node return only the first element?

Return Array is off by default, so only the first match is returned. Turn on Return Array in that extraction value to get every match as a list.

What does 'No property named "data" exists!' mean in the n8n HTML node?

Source Data is JSON but the item has no JSON field with that name, often because the HTTP Request node saved the page as a binary file. Set Source Data to Binary, or set JSON Property to the field that holds the HTML text.

Can I use XPath in the n8n HTML node?

No. It uses CSS selectors. An XPath such as //h1 failed with "Empty sub-selector" in our test. Use the CSS equivalent, such as h1, and pseudo-selectors like :nth-child or :contains.

How do I scrape links with the n8n HTML node?

Set Return Value to Attribute, Attribute to href and turn on Return Array. Relative links like /item/1 come back as they are, so add the site address in a later expression.

Related guides

New guides

Still stuck on your n8n error?

Paste the exact error and say what the workflow should do. We reproduce it on a real n8n install and email you the fix or a working workflow, usually within 24h. Free while we're in beta.

We'll only email you about your error and TaskToAgent.