8
n8n 中文网amn8n.com

通过 Bright Data 监控运动鞋价格下降

中级

这是一个AI领域的自动化工作流,包含 13 个节点。主要使用 If, Code, Html, Gmail, HttpRequest 等节点,结合人工智能技术实现智能自动化。 基于 Bright Data 和 n8n 的运动鞋降价提醒

前置要求
  • Google 账号和 Gmail API 凭证
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "5PoTonEYcOFEcNIS",
  "meta": {
    "instanceId": "60046904b104f0f72b2629a9d88fe9f676be4035769f1f08dad1dd38a76b9480",
    "templateCredsSetupCompleted": true
  },
  "name": "通过 Bright Data 监控运动鞋价格下降",
  "tags": [],
  "nodes": [
    {
      "id": "c51b6162-0268-43b5-85f7-2d5f72ba761a",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3360,
        -680
      ],
      "parameters": {
        "color": 4,
        "width": 1300,
        "height": 320,
        "content": "======================================="
      },
      "typeVersion": 1
    },
    {
      "id": "4f90e090-01ed-4b7a-83fe-059a4aafdebb",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3360,
        -340
      ],
      "parameters": {
        "color": 4,
        "width": 1289,
        "height": 2178,
        "content": "# 👟 **运动鞋降价提醒自动化**"
      },
      "typeVersion": 1
    },
    {
      "id": "332880a6-ee8f-4553-b5a1-4b80c4c8cc2c",
      "name": "检查价格 < 阈值1",
      "type": "n8n-nodes-base.if",
      "position": [
        -540,
        100
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "777acb15-4e75-43e5-a2fc-2799ef7e1b3f",
              "operator": {
                "type": "number",
                "operation": "lt"
              },
              "leftValue": "={{ $json.price }}",
              "rightValue": 200
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "96151916-77cc-44b8-9bf9-ef8db770aefd",
      "name": "发送降价邮件提醒1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -220,
        -60
      ],
      "webhookId": "481c69ca-1a74-4725-8473-cfebbb208ee4",
      "parameters": {
        "sendTo": "shahkar.genai@gmail.com",
        "message": "=Sneaker name: {{ $json.title }}\nCurrent Price: ${{ $json.price }}\nLink: https://stockx.com/category/sneakers",
        "options": {},
        "subject": "=The sneaker {{ $json.title }} has dropped below your threshold price.",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "AQDSl75AdzK3vmqJ",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f2411d03-fbea-4e7c-8833-a5f7699abb02",
      "name": "无操作,不执行任何操作",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -220,
        260
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5448a03e-dc95-41e3-8333-c31e2262ea1a",
      "name": "提取标题和价格",
      "type": "n8n-nodes-base.code",
      "position": [
        -800,
        100
      ],
      "parameters": {
        "jsCode": "const titles = items[0].json.Title;\nconst prices = items[0].json.Price;\n\nconst output = [];\n\nfor (let i = 0; i < titles.length; i++) {\n  const title = titles[i];\n  const priceStr = prices[i];\n  const price = parseFloat(priceStr.replace(/[^0-9.]/g, ''));\n\n  output.push({\n    json: {\n      title,\n      price\n    }\n  });\n}\n\nreturn output;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "7122595e-8bef-4b02-b19f-8a31786bc1d3",
      "name": "HTML 提取器",
      "type": "n8n-nodes-base.html",
      "position": [
        -1020,
        100
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "Title",
              "cssSelector": "#product-results > div > div > a > div > div.css-cp13gg > div.css-0 > p",
              "returnArray": true
            },
            {
              "key": "Price",
              "cssSelector": "#product-results > div > div > a > div > div.css-cp13gg > div.css-1b6n4o1 > div > p",
              "returnArray": true
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d95db7c4-786c-44f5-893b-9329dfe9ff43",
      "name": "HTTP 请求触发器 Bright Data 抓取器",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1240,
        100
      ],
      "parameters": {
        "url": "https://api.brightdata.com/request",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "zone",
              "value": "n8n_unblocker"
            },
            {
              "name": "url",
              "value": "https://stockx.com/category/sneakers"
            },
            {
              "name": "country",
              "value": "us"
            },
            {
              "name": "format",
              "value": "raw"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer API KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a0d899f0-9a4f-4e81-bbf5-8ff05e8151e4",
      "name": "定时触发器运行价格监控每天",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1460,
        100
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b5d711d4-a0fe-49ec-bc38-f3ca5872a53f",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        -680
      ],
      "parameters": {
        "color": 6,
        "width": 440,
        "height": 1040,
        "content": "## 🟢 **第一部分:通过 Bright Data 进行定时价格抓取**"
      },
      "typeVersion": 1
    },
    {
      "id": "7517433d-d579-44df-a165-966647985bbd",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -660
      ],
      "parameters": {
        "color": 5,
        "width": 400,
        "height": 1020,
        "content": "## 🟡 **第二部分:从 HTML 中提取运动鞋信息**"
      },
      "typeVersion": 1
    },
    {
      "id": "226d36ab-ef43-4bc0-a932-4187b3399311",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -600,
        -740
      ],
      "parameters": {
        "color": 3,
        "width": 540,
        "height": 1140,
        "content": "## 🔴 **第三部分:检查优惠并发送提醒**"
      },
      "typeVersion": 1
    },
    {
      "id": "612031dd-780a-4091-914f-38e903f1902b",
      "name": "便利贴5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        -740
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 240,
        "content": "## 如果您通过此链接加入 Bright Data,我将获得少量佣金 — 感谢您支持更多免费内容!"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "136b1b1c-6d37-40e3-9c94-0012af157f83",
  "connections": {
    "HTML Extractor": {
      "main": [
        [
          {
            "node": "Extract Title & Price",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Title & Price": {
      "main": [
        [
          {
            "node": "Check Price < Threshold1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Price < Threshold1": {
      "main": [
        [
          {
            "node": "Send Price Drop Email Alert1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP RequestTrigger Bright Data Scraper": {
      "main": [
        [
          {
            "node": "HTML Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule TriggerRun Price Monitor Everyday": {
      "main": [
        [
          {
            "node": "HTTP RequestTrigger Bright Data Scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 人工智能

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量13
分类1
节点类型8
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Yaron Been

Yaron Been

@yaron-nofluff

Building AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host If you need any help with Automations, feel free to reach out via linkedin: https://www.linkedin.com/in/yaronbeen/ And check out my Youtube channel: https://www.youtube.com/@YaronBeen/videos

外部链接
在 n8n.io 查看

分享此工作流