竞争价格监控(网络爬虫、Google Sheets 和 Discord 警报)
高级
这是一个Market Research领域的自动化工作流,包含 21 个节点。主要使用 If, Code, Html, Discord, HttpRequest 等节点。 使用网络爬虫、Google Sheets 和 Discord 警报进行竞争价格监控
前置要求
- •Discord Bot Token 或 Webhook
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
分类
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "bfc245d93526dceb7636f8b1e64128b218e1b1dd93d65d163c189ecbc1cc0b90",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "646a8d10-7ded-4f80-aa17-86c53bddbc43",
"name": "计划触发器",
"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": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
780,
380
],
"parameters": {
"width": 660,
"height": 380,
"content": "## 将已检查列设置为\"0\"以备次日检查"
},
"typeVersion": 1
},
{
"id": "f5dbaff2-5cdc-474c-8f6e-0ec299730a0f",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
500,
120
],
"parameters": {
"color": 4,
"width": 200,
"height": 200,
"content": "价格检查完成消息发送到 Discord"
},
"typeVersion": 1
},
{
"id": "b5d5c422-af74-408a-b060-3e5bf8c6578d",
"name": "获取未检查行",
"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 请求",
"type": "n8n-nodes-base.httpRequest",
"position": [
420,
-105
],
"parameters": {
"url": "={{ $json['Competitor URL'] }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "0b842eec-6f2d-4c62-ab00-403164951e64",
"name": "从页面提取价格",
"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": "将价格转换为数字的代码",
"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": "价格是否高于我方?",
"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": "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": "将状态更新为 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": "获取状态行",
"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": "是否有行返回?",
"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": "将状态重置为 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": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-820,
40
],
"parameters": {
"width": 300,
"height": 280,
"content": "## 按所需计划开始"
},
"typeVersion": 1
},
{
"id": "2a156baa-d3fc-4d73-8241-d6021ddf1514",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
360,
-220
],
"parameters": {
"width": 860,
"height": 300,
"content": "## 从竞争对手产品页面获取价格并转换为数字"
},
"typeVersion": 1
},
{
"id": "5e3db4b8-4bb7-477e-873c-ac77a5536ce1",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-340,
-20
],
"parameters": {
"width": 180,
"height": 340,
"content": "## 获取未检查行"
},
"typeVersion": 1
},
{
"id": "644a8dbc-6f7b-49cb-bc7b-96157db7a4ea",
"name": "行是否存在?",
"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": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1260,
-380
],
"parameters": {
"color": 3,
"width": 180,
"height": 380,
"content": "## Discord 警报"
},
"typeVersion": 1
},
{
"id": "5e289971-7536-4c4f-a508-eb8af7e63fb9",
"name": "便签6",
"type": "n8n-nodes-base.stickyNote",
"position": [
1480,
-20
],
"parameters": {
"width": 260,
"height": 260,
"content": "## 将已检查设置为 1"
},
"typeVersion": 1
},
{
"id": "107fdca7-f641-4237-851a-776b63f5949c",
"name": "便签7",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
-100
],
"parameters": {
"width": 260,
"height": 360,
"content": "## 是否存在未检查行?"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Discord1": {
"main": [
[
{
"node": "Get status row",
"type": "main",
"index": 0
}
]
]
},
"row exist?": {
"main": [
[
{
"node": "HTTP Request to product page",
"type": "main",
"index": 0
}
],
[
{
"node": "Discord1",
"type": "main",
"index": 0
}
]
]
},
"row returned?": {
"main": [
[
{
"node": "Update status back to 0",
"type": "main",
"index": 0
}
]
]
},
"Get status row": {
"main": [
[
{
"node": "row returned?",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "get unchecked row",
"type": "main",
"index": 0
}
]
]
},
"get unchecked row": {
"main": [
[
{
"node": "row exist?",
"type": "main",
"index": 0
}
]
]
},
"Update status to 1": {
"main": [
[
{
"node": "get unchecked row",
"type": "main",
"index": 0
}
]
]
},
"Discord price alert": {
"main": [
[
{
"node": "Update status to 1",
"type": "main",
"index": 0
}
]
]
},
"Update status back to 0": {
"main": [
[
{
"node": "Get status row",
"type": "main",
"index": 0
}
]
]
},
"price extract from page": {
"main": [
[
{
"node": "Code to convert price into number",
"type": "main",
"index": 0
}
]
]
},
"price greater than ours?": {
"main": [
[
{
"node": "Discord price alert",
"type": "main",
"index": 0
}
],
[
{
"node": "Update status to 1",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request to product page": {
"main": [
[
{
"node": "price extract from page",
"type": "main",
"index": 0
}
]
]
},
"Code to convert price into number": {
"main": [
[
{
"node": "price greater than ours?",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 市场调研
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
科技新闻聚合器:The Verge和TechCrunch RSS到Notion,含GPT-4摘要
科技新闻聚合器:The Verge和TechCrunch RSS到Notion,含GPT-4摘要
If
Code
Html
+11
37 节点moosa
杂项
基于AI、Bright Data、Sheets和Slack的联盟竞争对手追踪与分析
使用AI、Bright Data、Sheets和Slack进行联盟竞争对手追踪与分析
If
Set
Code
+6
23 节点Daniel Shashko
市场调研
MetaAds创意洞察研究员v1.4
使用Google Vision和Video Intelligence API分析Meta广告创意
If
Set
Code
+9
32 节点Kirill Khatkevich
市场调研
我的工作流 2
结合 AI 竞品监控和收入优化的自动化动态定价
If
Code
Merge
+8
25 节点vinci-king-01
市场调研
无重复的 RSS 阅读器
使用 Gemini AI 摘要和去重到 Google Sheets 的自动化 RSS 监控
If
Set
Html
+12
23 节点Roman Rozenberger
市场调研
多平台评论聚合器
集中式评论聚合器:从Trustpilot、Google、Facebook汇总到Google Sheets
If
Code
Shopify
+4
13 节点David Olusola
市场调研