{ "createdAt": "2021-03-03T10:18:29.938Z", "updatedAt": "2021-03-03T10:18:35.288Z", "id": "91", "name": "HTML Extract:json binary", "active": false, "nodes": [ { "parameters": {}, "name": "Start", "type": "n8n-nodes-base.start", "typeVersion": 1, "position": [ 250, 300 ], "id": "51f39bec-0696-4ff7-93a8-26d105a5edfc" }, { "parameters": { "functionCode": "item.data = `\n\n\n\n
\"background
\"background
\"background

\n\t\t\t\t\t\tExtendable workflow automation\n\t\t\t\t\t

\"n8n
\n\t\tGithub\n\t
\"Play

\n\t\t\t\t\t\tWatch how simple it is to design a\n\t\t\t\t\t\tTypeform +\n\t\t\t\t\t\tGoogle Sheets +\n\t\t\t\t\t\tSlack workflow\n\t\t\t\t\t

Open icon

Open

\n\t\t\t\t\t\tThanks to our fair-code license, run n8n locally, or the cloud.\n\t\t\t\t\t\tDecide who gets access and where your data is stored.\n\t\t\t\t\t

Extendable icon

Extendable

\n\t\t\t\t\t\tEasy to augment with custom functions logic, and apps with minimal\n\t\t\t\t\t\tengineering effort.\n\t\t\t\t\t

Powerful icon

Powerful

\n\t\t\t\t\t\tn8n's node based editor lets you map anything to everything and go\n\t\t\t\t\t\tbeyond basic ETL.\n\t\t\t\t\t

What can I do with n8n?

Sync data between 150+ apps

\n\t\t\t\t\t\t\tMove and transform data between different apps and databases without getting caught up in API docs and troubleshooting CORS errors.\n\t\t\t\t\t\t

Design powerful workflows

Create custom integrations

\n\t\t\t\t\t\t\tSee what else you can do with n8n! Visit our\n\t\t\t\t\t\t\tMedium publication

How to get started?

\n\t\t\t\t\t\tCLI\n\t\t\t\t\t

\n\t\tClick to copy\n\t
\n\t\tClick to copy\n\t

\n\t\t\t\t\t\tDocker\n\t\t\t\t\t

\n\t\tClick to copy\n\t
\n\t\t\t\t\t\t\t\tn8n.cloud - our hosted offering is now in early access\n\t\t\t\t\t\t\t

\n\t\t\t\t\t\tGet updates from n8n\n\t\t\t\t\t

Subscribe to our newsletter

\n\t\tBy submitting your email address you agree to your personal data being\n\t\tstored and used to provide you with information and commercial offers\n\t\tabout n8n.\n\t

\n
\n\n`;\nreturn item;" }, "name": "FunctionItem", "type": "n8n-nodes-base.functionItem", "typeVersion": 1, "position": [ 450, 300 ], "notesInFlow": true, "notes": "Set html data", "id": "70ab3e66-cac8-45fd-917d-838e2538ad69" }, { "parameters": { "extractionValues": { "values": [ { "key": "extracted", "cssSelector": "li>a", "returnArray": true } ] }, "options": { "trimValues": true } }, "name": "HTML Extract", "type": "n8n-nodes-base.htmlExtract", "typeVersion": 1, "position": [ 650, 300 ], "id": "f27a2f9c-1946-4cac-96fe-d980fe2e5077" }, { "parameters": { "functionCode": "testData = [ \"Quickstart\", \"Apps & nodes\", \"Workflows\", \"Docs\", \"Github\", \"Forum\", \"Blog\", \"Contribute\", \"n8n.cloud\", \"Sign in\", \"Register\", \"Quickstart\", \"Apps & nodes\", \"Workflows\", \"Docs\", \"Github\", \"Forum\", \"Blog\", \"Contribute\", \"n8n.cloud\", \"Sign in\", \"Register\" ].join('');\nresultData = $node[\"HTML Extract\"].json[\"extracted\"].join('')\nif(testData !== resultData){\n throw new Error('Error in extracting html from json data');\n}\nreturn items;" }, "name": "Function", "type": "n8n-nodes-base.function", "typeVersion": 1, "position": [ 850, 300 ], "notesInFlow": true, "notes": "Verify the result", "id": "97bc0163-8d74-4f5b-b65c-ec1354333908" }, { "parameters": { "mode": "jsonToBinary", "convertAllData": false, "options": { "useRawData": true } }, "name": "Move Binary Data", "type": "n8n-nodes-base.moveBinaryData", "typeVersion": 1, "position": [ 650, 500 ], "id": "c25511ef-8cbc-4d29-bc2f-3983d900e802" }, { "parameters": { "sourceData": "binary", "extractionValues": { "values": [ { "key": "extracted", "cssSelector": "li>a", "returnArray": true } ] }, "options": { "trimValues": true } }, "name": "HTML Extract1", "type": "n8n-nodes-base.htmlExtract", "typeVersion": 1, "position": [ 850, 500 ], "id": "9df0c1ed-008b-4820-958f-c87330a9000d" }, { "parameters": { "functionCode": "testData = [ \"Quickstart\", \"Apps & nodes\", \"Workflows\", \"Docs\", \"Github\", \"Forum\", \"Blog\", \"Contribute\", \"n8n.cloud\", \"Sign in\", \"Register\", \"Quickstart\", \"Apps & nodes\", \"Workflows\", \"Docs\", \"Github\", \"Forum\", \"Blog\", \"Contribute\", \"n8n.cloud\", \"Sign in\", \"Register\" ].join('');\nresultData = $node[\"HTML Extract1\"].json[\"extracted\"].join('')\nif(testData !== resultData){\n throw new Error('Error in extracting html from binary data');\n}\nreturn items;" }, "name": "Function1", "type": "n8n-nodes-base.function", "typeVersion": 1, "position": [ 1050, 500 ], "notesInFlow": true, "notes": "Verify the result", "id": "a36ed52d-5256-4cbf-b96f-596574b092fc" } ], "connections": { "FunctionItem": { "main": [ [ { "node": "HTML Extract", "type": "main", "index": 0 }, { "node": "Move Binary Data", "type": "main", "index": 0 } ] ] }, "Start": { "main": [ [ { "node": "FunctionItem", "type": "main", "index": 0 } ] ] }, "HTML Extract": { "main": [ [ { "node": "Function", "type": "main", "index": 0 } ] ] }, "Move Binary Data": { "main": [ [ { "node": "HTML Extract1", "type": "main", "index": 0 } ] ] }, "HTML Extract1": { "main": [ [ { "node": "Function1", "type": "main", "index": 0 } ] ] } }, "settings": {}, "staticData": null, "meta": null, "pinData": null, "versionId": null, "triggerCount": 0, "tags": [] }