HTML Extract ERROR: No item does not contain binary data!

Hi.
I am getting this error:
ERROR: No item does not contain binary data!
on:

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        -100,
        100
      ]
    },
    {
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 2
            }
          ]
        }
      },
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        70,
        100
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "getAll",
        "limit": 2,
        "additionalFields": {
          "format": "resolved",
          "labelIds": [
            "Label_1142371532314808565"
          ],
          "q": "=Subject: We received your mobile check deposit"
        }
      },
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 1,
      "position": [
        270,
        100
      ],
      "credentials": {
        "gmailOAuth2": "[email protected]"
      }
    },
    {
      "parameters": {
        "keepOnlySet": "={{$parameter[\"values\"][\"string\"][0][\"name\"]}}",
        "values": {
          "number": [],
          "string": [
            {
              "name": "=propertyName",
              "value": "="
            }
          ]
        },
        "options": {}
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "position": [
        680,
        100
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "append",
        "sheetId": "1aSqKnmsQVLlC5CyWLxjsm3U0F7tLnRT92_nlYNzXy54",
        "range": "A:D",
        "options": {
          "valueInputMode": "USER_ENTERED"
        }
      },
      "name": "Google Sheets4",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        930,
        100
      ],
      "typeVersion": 1,
      "credentials": {
        "googleSheetsOAuth2Api": "n2n.getstheworm.com [email protected]"
      }
    },
    {
      "parameters": {
        "sourceData": "binary",
        "dataPropertyName": "=data",
        "extractionValues": {
          "values": [
            {
              "key": "=item",
              "cssSelector": "h2",
              "returnValue": "html",
              "returnArray": true
            }
          ]
        },
        "options": {}
      },
      "name": "HTML Extract2",
      "type": "n8n-nodes-base.htmlExtract",
      "position": [
        440,
        90
      ],
      "typeVersion": 1
    }
  ],
  "connections": {
    "Cron": {
      "main": [
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail": {
      "main": [
        [
          {
            "node": "HTML Extract2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "Google Sheets4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML Extract2": {
      "main": [
        [
          {
            "node": "HTML Extract2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

It is based on https://n8n.io/workflows/434.
I searched for this error message on: https://docs.n8n.io/nodes/n8n-nodes-base.errorTrigger/, but I don’t see any information on this or how to fix it.
What do you recommend?
Thanks,
Josh

The error message actually says exactly what the problem is. The item does not contain any binary data.

So you are telling the “HTML Extract” Node to read the binary property “data” but there is not binary property named “data” on the item. There is actually no binary data on that item at all. As the node needs binary data to do its job, it errors and tells you about that.

I am also quite confused about that workflow in general. Why is the “HTML Extract” Node connected to itself? Why is there no node at all connected to the Set-Node?

I assume you can simply remove the loop and change the binary property name on the “HTML Extract” Node to the actual value which I guess would be “attachment_0”.

Hope that helps!

1 Like

I am trying to extract text from a Gmail message.
GMail is the source of the data.
It is connected to itself because I copied it from the URL I mentioned earlier (https://n8n.io/workflows/434).
Is there a better way to do this?

But the example workflow you are referencing does not have this loop. So do not really understand.

Wrote already above how you should be able to solve that issue. Did you try that?

1 Like

I restructured the workflow, but I get the same error:

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        -100,
        100
      ]
    },
    {
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 2
            }
          ]
        }
      },
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        70,
        100
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "getAll",
        "additionalFields": {
          "format": "resolved",
          "labelIds": [
            "Label_1142371532314808565"
          ],
          "q": "=Subject: We received your mobile check deposit"
        }
      },
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 1,
      "position": [
        260,
        100
      ],
      "credentials": {
        "gmailOAuth2": "(redacted)"
      }
    },
    {
      "parameters": {
        "keepOnlySet": "={{$parameter[\"values\"][\"string\"][0][\"name\"]}}",
        "values": {
          "number": [],
          "string": [
            {
              "name": "Check amount",
              "value": "={{$parameter[\"values\"][\"string\"][0][\"name\"]}}"
            },
            {
              "name": "Account"
            },
            {
              "name": "Posts On"
            },
            {
              "name": "Confirmation #"
            }
          ]
        },
        "options": {}
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "position": [
        680,
        100
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "append",
        "sheetId": "(redacted)",
        "range": "A:D",
        "options": {
          "valueInputMode": "USER_ENTERED"
        }
      },
      "name": "Google Sheets4",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        930,
        100
      ],
      "typeVersion": 1,
      "credentials": {
        "googleSheetsOAuth2Api": "(redacted)"
      }
    },
    {
      "parameters": {
        "dataPropertyName": "={{$node[\"Gmail\"].json[\"subject\"]}}",
        "extractionValues": {
          "values": [
            {}
          ]
        },
        "options": {}
      },
      "name": "HTML Extract",
      "type": "n8n-nodes-base.htmlExtract",
      "typeVersion": 1,
      "position": [
        470,
        100
      ]
    },
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        -100,
        100
      ]
    },
    {
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 2
            }
          ]
        }
      },
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        70,
        100
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "getAll",
        "additionalFields": {
          "format": "resolved",
          "labelIds": [
            "Label_1142371532314808565"
          ],
          "q": "=Subject: We received your mobile check deposit"
        }
      },
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 1,
      "position": [
        260,
        100
      ],
      "credentials": {
        "gmailOAuth2": "(redacted)"
      }
    },
    {
      "parameters": {
        "keepOnlySet": "={{$parameter[\"values\"][\"string\"][0][\"name\"]}}",
        "values": {
          "number": [],
          "string": [
            {
              "name": "Check amount",
              "value": "={{$parameter[\"values\"][\"string\"][0][\"name\"]}}"
            },
            {
              "name": "Account"
            },
            {
              "name": "Posts On"
            },
            {
              "name": "Confirmation #"
            }
          ]
        },
        "options": {}
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "position": [
        680,
        100
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "append",
        "sheetId": "(redacted)",
        "range": "A:D",
        "options": {
          "valueInputMode": "USER_ENTERED"
        }
      },
      "name": "Google Sheets4",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        930,
        100
      ],
      "typeVersion": 1,
      "credentials": {
        "googleSheetsOAuth2Api": "(redacted)"
      }
    },
    {
      "parameters": {
        "dataPropertyName": "={{$node[\"Gmail\"].json[\"subject\"]}}",
        "extractionValues": {
          "values": [
            {}
          ]
        },
        "options": {}
      },
      "name": "HTML Extract",
      "type": "n8n-nodes-base.htmlExtract",
      "typeVersion": 1,
      "position": [
        470,
        100
      ]
    }
  ],
  "connections": {
    "Cron": {
      "main": [
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail": {
      "main": [
        [
          {
            "node": "HTML Extract",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "Google Sheets4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML Extract": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

The odd thing is that “We received your mobile check deposit” is present in the GMail module, and this phrase is detected in the HTML Extract module:


So, I am not sure (and the hard-to-decipher error message is not helpful determining) what is going wrong or how to fix it.

The workflow does honestly not make any sense to me at all. Can you please explain what you want to do exactly, how the email looks like, from where you try to extract the data (from the text of the email or an attachment, with example-data), and so on. I should then probably be able to create a workflow that does that.

It’s really quite simple. :wink:
I want to use a cron to check for all Gmail messages with a specific label, and then parse them, and send specific information to Google Sheets.

Can you please tell me what you want to parse and from where (the message or the HTML attachment).

The message, please: the subject line and body text, please.

Then you can do the following:

{
  "nodes": [
    {
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 2
            }
          ]
        }
      },
      "name": "Cron1",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "getAll",
        "additionalFields": {
          "format": "resolved",
          "labelIds": [
            "Label_1142371532314808565"
          ],
          "q": "=Subject: We received your mobile check deposit"
        }
      },
      "name": "Gmail1",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 1,
      "position": [
        650,
        300
      ],
      "credentials": {
        "gmailOAuth2": "(redacted)"
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "append",
        "sheetId": "(redacted)",
        "range": "A:D",
        "options": {
          "valueInputMode": "USER_ENTERED"
        }
      },
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1050,
        300
      ],
      "typeVersion": 1,
      "credentials": {
        "googleSheetsOAuth2Api": "(redacted)"
      }
    },
    {
      "parameters": {
        "dataPropertyName": "html",
        "extractionValues": {
          "values": [
            {
              "key": "Check amount",
              "cssSelector": "#amount"
            },
            {
              "key": "Account",
              "cssSelector": "#account"
            },
            {
              "key": "Posts On",
              "cssSelector": "#posts-on"
            },
            {
              "key": "Confirmation #",
              "cssSelector": "#confirmation-id"
            }
          ]
        },
        "options": {}
      },
      "name": "HTML Extract1",
      "type": "n8n-nodes-base.htmlExtract",
      "typeVersion": 1,
      "position": [
        850,
        300
      ]
    }
  ],
  "connections": {
    "Cron1": {
      "main": [
        [
          {
            "node": "Gmail1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail1": {
      "main": [
        [
          {
            "node": "HTML Extract1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML Extract1": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

That will extract data from the HTML of the email.

You now have to however find the correct values for all the “CSS Selector” parameters. Depending on the HTML of the email and your experience doing that will it be very simple to almost impossible.

If you control the email you want to scrape the information from (or you can get them to change it) it would be the simplest if they would add id="???" properties like id="amount". Then you could use exactly the workflow from my example above.