Skip to content

Instantly share code, notes, and snippets.

@ed-parsadanyan
Last active May 9, 2022 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ed-parsadanyan/9180301ed0d07a31411f62476d289802 to your computer and use it in GitHub Desktop.
Save ed-parsadanyan/9180301ed0d07a31411f62476d289802 to your computer and use it in GitHub Desktop.
n8n extract gas price
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
240,
300
]
},
{
"parameters": {
"url": "https://multigo.ru/benzin/53.7572;87.1363/8",
"responseFormat": "file",
"options": {}
},
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
460,
300
]
},
{
"parameters": {
"sourceData": "binary",
"extractionValues": {
"values": [
{
"key": "name",
"cssSelector": ".fuel-box__title",
"returnArray": true
},
{
"key": "price",
"cssSelector": ".fuel-box__price",
"returnArray": true
}
]
},
"options": {
"trimValues": true
}
},
"name": "HTML Extract",
"type": "n8n-nodes-base.htmlExtract",
"typeVersion": 1,
"position": [
680,
300
]
},
{
"parameters": {
"fieldToSplitOut": "name",
"options": {}
},
"name": "Item Lists",
"type": "n8n-nodes-base.itemLists",
"typeVersion": 1,
"position": [
960,
200
]
},
{
"parameters": {
"fieldToSplitOut": "price",
"options": {}
},
"name": "Item Lists1",
"type": "n8n-nodes-base.itemLists",
"typeVersion": 1,
"position": [
960,
400
]
},
{
"parameters": {
"mode": "mergeByIndex"
},
"name": "Merge",
"type": "n8n-nodes-base.merge",
"typeVersion": 1,
"position": [
1200,
300
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "price",
"value": "={{$json[\"price\"].replace('.',',')}}"
}
]
},
"options": {}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1420,
300
]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "HTML Extract",
"type": "main",
"index": 0
}
]
]
},
"HTML Extract": {
"main": [
[
{
"node": "Item Lists",
"type": "main",
"index": 0
},
{
"node": "Item Lists1",
"type": "main",
"index": 0
}
]
]
},
"Item Lists": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Item Lists1": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Set",
"type": "main",
"index": 0
}
]
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment