Suivi des prix concurrentiels (scraping web, Google Sheets et alertes Discord)

Avancé

Ceci est unMarket Researchworkflow d'automatisation du domainecontenant 21 nœuds.Utilise principalement des nœuds comme If, Code, Html, Discord, HttpRequest. Utiliser des web scrapers, Google Sheets et des alertes Discord pour la surveillance des prix concurrentiels

Prérequis
  • Token Bot Discord ou Webhook
  • Peut nécessiter les informations d'identification d'authentification de l'API cible
  • Informations d'identification Google Sheets API
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "meta": {
    "instanceId": "bfc245d93526dceb7636f8b1e64128b218e1b1dd93d65d163c189ecbc1cc0b90",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "646a8d10-7ded-4f80-aa17-86c53bddbc43",
      "name": "Déclencheur planifié",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -680,
        140
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c5199922-2c7e-4752-b016-b9c7715f6ed1",
      "name": "Discord1",
      "type": "n8n-nodes-base.discord",
      "position": [
        560,
        180
      ],
      "webhookId": "1afc816c-6d68-499b-936a-f76b220dd651",
      "parameters": {
        "content": "Price checks complete.",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "id": "R7mNwWe0jAFbTAB9",
          "name": "Discord Webhook account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e21bf2ed-e964-479e-9097-3b35d834d9ee",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        380
      ],
      "parameters": {
        "width": 660,
        "height": 380,
        "content": "## setting checked column to \"0\" for next day checks"
      },
      "typeVersion": 1
    },
    {
      "id": "f5dbaff2-5cdc-474c-8f6e-0ec299730a0f",
      "name": "Note adhésive1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        120
      ],
      "parameters": {
        "color": 4,
        "width": 200,
        "height": 200,
        "content": "price checks completed message to discord"
      },
      "typeVersion": 1
    },
    {
      "id": "b5d5c422-af74-408a-b060-3e5bf8c6578d",
      "name": "obtenir une ligne non vérifiée",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -300,
        140
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": true
        },
        "filtersUI": {
          "values": [
            {
              "lookupValue": "0",
              "lookupColumn": "checked"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16-hEaIl8Tng5SB5jbpu26kT7G-g1cFM5_w2AILwT3Pc/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "16-hEaIl8Tng5SB5jbpu26kT7G-g1cFM5_w2AILwT3Pc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16-hEaIl8Tng5SB5jbpu26kT7G-g1cFM5_w2AILwT3Pc/edit?usp=drivesdk",
          "cachedResultName": "price-check-sheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "b57GlApcZwTGd5nZ",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6,
      "alwaysOutputData": true
    },
    {
      "id": "cee99b2f-6d63-40dc-bbfc-d98dc6bd3449",
      "name": "HTTP Requête vers la page produit",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        420,
        -105
      ],
      "parameters": {
        "url": "={{ $json['Competitor URL'] }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "0b842eec-6f2d-4c62-ab00-403164951e64",
      "name": "extraire le prix de la page",
      "type": "n8n-nodes-base.html",
      "position": [
        640,
        -105
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "price",
              "cssSelector": ".price_color"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cce7d4e7-98a5-4c70-b90f-007ee6402e94",
      "name": "Code pour convertir le prix en nombre",
      "type": "n8n-nodes-base.code",
      "position": [
        860,
        -105
      ],
      "parameters": {
        "jsCode": "const priceStr = $input.first().json.price\nconst priceNumber = parseFloat(priceStr.replace(\"£\", \"\").trim());\n\nreturn [{ json: { price: priceNumber } }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "f74511f8-a89b-44ab-be06-74bc6522cec5",
      "name": "prix supérieur au nôtre ?",
      "type": "n8n-nodes-base.if",
      "position": [
        1080,
        -105
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "37f18553-eb25-4f11-9803-73db6f67091c",
              "operator": {
                "type": "number",
                "operation": "lt"
              },
              "leftValue": "={{ $json.price }}",
              "rightValue": "={{ $('get unchecked row').item.json['my Price'] }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d597ca2e-2e41-45c0-a8da-b1285bde2cd6",
      "name": "alerte prix Discord",
      "type": "n8n-nodes-base.discord",
      "position": [
        1300,
        -180
      ],
      "webhookId": "56fe5f69-c879-4d1d-b436-588bf79e3d43",
      "parameters": {
        "content": "=competitor has decreased price on product: {{ $('get unchecked row').item.json['Product Name'] }}\n\nour price: {{ $('get unchecked row').item.json['my Price'] }}\ncompetitor's price:{{ $('Code to convert price into number').item.json.price }}",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "id": "R7mNwWe0jAFbTAB9",
          "name": "Discord Webhook account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "ded0c28b-e4d1-494a-bd6f-e2b88bb12c61",
      "name": "Mettre à jour le statut à 1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1520,
        95
      ],
      "parameters": {
        "columns": {
          "value": {
            "checked": "1",
            "Product Name": "={{ $('get unchecked row').item.json['Product Name'] }}",
            "competitor price": "={{ $('Code to convert price into number').item.json.price }}"
          },
          "schema": [
            {
              "id": "Product Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Product Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "my Price",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "my Price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Competitor URL",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Competitor URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor price",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "competitor price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "checked",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "checked",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Product Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16-hEaIl8Tng5SB5jbpu26kT7G-g1cFM5_w2AILwT3Pc/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "16-hEaIl8Tng5SB5jbpu26kT7G-g1cFM5_w2AILwT3Pc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16-hEaIl8Tng5SB5jbpu26kT7G-g1cFM5_w2AILwT3Pc/edit?usp=drivesdk",
          "cachedResultName": "price-check-sheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "b57GlApcZwTGd5nZ",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "6b784dd4-681b-4e80-83ca-80dbe0e1e519",
      "name": "Obtenir la ligne de statut",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        840,
        520
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": true
        },
        "filtersUI": {
          "values": [
            {
              "lookupValue": "1",
              "lookupColumn": "checked"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16-hEaIl8Tng5SB5jbpu26kT7G-g1cFM5_w2AILwT3Pc/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "16-hEaIl8Tng5SB5jbpu26kT7G-g1cFM5_w2AILwT3Pc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16-hEaIl8Tng5SB5jbpu26kT7G-g1cFM5_w2AILwT3Pc/edit?usp=drivesdk",
          "cachedResultName": "price-check-sheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "b57GlApcZwTGd5nZ",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6,
      "alwaysOutputData": true
    },
    {
      "id": "af9aea9b-5370-439f-8bf7-84159b3bb1cf",
      "name": "ligne retournée ?",
      "type": "n8n-nodes-base.if",
      "position": [
        1060,
        440
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "998fc0d0-8d33-43cb-b6e8-f9516c28b55f",
              "operator": {
                "type": "object",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "af494912-3a5a-4b78-a0c4-57a3f1be5af6",
      "name": "Mettre à jour le statut à 0",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1280,
        520
      ],
      "parameters": {
        "columns": {
          "value": {
            "checked": "0",
            "Product Name": "={{ $json[\"Product Name\"] }}"
          },
          "schema": [
            {
              "id": "Product Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Product Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "my Price",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "my Price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Competitor URL",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Competitor URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor price",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "competitor price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "checked",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "checked",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Product Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16-hEaIl8Tng5SB5jbpu26kT7G-g1cFM5_w2AILwT3Pc/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "16-hEaIl8Tng5SB5jbpu26kT7G-g1cFM5_w2AILwT3Pc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/16-hEaIl8Tng5SB5jbpu26kT7G-g1cFM5_w2AILwT3Pc/edit?usp=drivesdk",
          "cachedResultName": "price-check-sheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "b57GlApcZwTGd5nZ",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "6c1fe1cd-56af-4c51-91b3-d5eaa9ce2948",
      "name": "Note adhésive2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -820,
        40
      ],
      "parameters": {
        "width": 300,
        "height": 280,
        "content": "## start at desired schedule\n### daily in this example"
      },
      "typeVersion": 1
    },
    {
      "id": "2a156baa-d3fc-4d73-8241-d6021ddf1514",
      "name": "Note adhésive3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        -220
      ],
      "parameters": {
        "width": 860,
        "height": 300,
        "content": "## get price from competitor's product page and convert into number\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5e3db4b8-4bb7-477e-873c-ac77a5536ce1",
      "name": "Note adhésive4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        -20
      ],
      "parameters": {
        "width": 180,
        "height": 340,
        "content": "## get un checked roe\n- ### extract name, page-url, our price"
      },
      "typeVersion": 1
    },
    {
      "id": "644a8dbc-6f7b-49cb-bc7b-96157db7a4ea",
      "name": "la ligne existe ?",
      "type": "n8n-nodes-base.if",
      "position": [
        100,
        140
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "8dd1be30-0d27-4c75-9d0b-c0db05a0fb4f",
              "operator": {
                "type": "object",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json}}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "2bae4c20-dabc-4833-9524-46308c3017b3",
      "name": "Note adhésive5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1260,
        -380
      ],
      "parameters": {
        "color": 3,
        "width": 180,
        "height": 380,
        "content": "## discord alert \n- ### our price is greater than competition"
      },
      "typeVersion": 1
    },
    {
      "id": "5e289971-7536-4c4f-a508-eb8af7e63fb9",
      "name": "Note adhésive6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1480,
        -20
      ],
      "parameters": {
        "width": 260,
        "height": 260,
        "content": "## set checked to 1"
      },
      "typeVersion": 1
    },
    {
      "id": "107fdca7-f641-4237-851a-776b63f5949c",
      "name": "Note adhésive7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -100
      ],
      "parameters": {
        "width": 260,
        "height": 360,
        "content": "## if unchecked row exist?\n- ### yes? (then extracts data)\n- ### else sends message checks are done and set checks to 0 for next day checks "
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "c5199922-2c7e-4752-b016-b9c7715f6ed1": {
      "main": [
        [
          {
            "node": "6b784dd4-681b-4e80-83ca-80dbe0e1e519",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "644a8dbc-6f7b-49cb-bc7b-96157db7a4ea": {
      "main": [
        [
          {
            "node": "cee99b2f-6d63-40dc-bbfc-d98dc6bd3449",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "c5199922-2c7e-4752-b016-b9c7715f6ed1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "af9aea9b-5370-439f-8bf7-84159b3bb1cf": {
      "main": [
        [
          {
            "node": "af494912-3a5a-4b78-a0c4-57a3f1be5af6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6b784dd4-681b-4e80-83ca-80dbe0e1e519": {
      "main": [
        [
          {
            "node": "af9aea9b-5370-439f-8bf7-84159b3bb1cf",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "646a8d10-7ded-4f80-aa17-86c53bddbc43": {
      "main": [
        [
          {
            "node": "b5d5c422-af74-408a-b060-3e5bf8c6578d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b5d5c422-af74-408a-b060-3e5bf8c6578d": {
      "main": [
        [
          {
            "node": "644a8dbc-6f7b-49cb-bc7b-96157db7a4ea",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ded0c28b-e4d1-494a-bd6f-e2b88bb12c61": {
      "main": [
        [
          {
            "node": "b5d5c422-af74-408a-b060-3e5bf8c6578d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d597ca2e-2e41-45c0-a8da-b1285bde2cd6": {
      "main": [
        [
          {
            "node": "ded0c28b-e4d1-494a-bd6f-e2b88bb12c61",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "af494912-3a5a-4b78-a0c4-57a3f1be5af6": {
      "main": [
        [
          {
            "node": "6b784dd4-681b-4e80-83ca-80dbe0e1e519",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0b842eec-6f2d-4c62-ab00-403164951e64": {
      "main": [
        [
          {
            "node": "cce7d4e7-98a5-4c70-b90f-007ee6402e94",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f74511f8-a89b-44ab-be06-74bc6522cec5": {
      "main": [
        [
          {
            "node": "d597ca2e-2e41-45c0-a8da-b1285bde2cd6",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "ded0c28b-e4d1-494a-bd6f-e2b88bb12c61",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cee99b2f-6d63-40dc-bbfc-d98dc6bd3449": {
      "main": [
        [
          {
            "node": "0b842eec-6f2d-4c62-ab00-403164951e64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cce7d4e7-98a5-4c70-b90f-007ee6402e94": {
      "main": [
        [
          {
            "node": "f74511f8-a89b-44ab-be06-74bc6522cec5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Avancé - Étude de marché

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Avancé
Nombre de nœuds21
Catégorie1
Types de nœuds8
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34