8
n8n 中文网amn8n.com

使用n8n绕过Cloudflare Turnstile进行网络爬取

高级

这是一个Engineering, Multimodal AI领域的自动化工作流,包含 18 个节点。主要使用 Set, Code, Wait, Switch, HttpRequest 等节点。 使用2captcha绕过Cloudflare Turnstile进行网络爬取

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "YU0WAOtF9hea7N32",
  "meta": {
    "instanceId": "c7039d042d103221917f465e8e30a54f54e009888e5fcc7fe09f0fc8c8f31c07",
    "templateCredsSetupCompleted": true
  },
  "name": "使用n8n绕过Cloudflare Turnstile进行网络爬取",
  "tags": [],
  "nodes": [
    {
      "id": "82693aca-f1ba-42a6-aa00-46043a6ee20d",
      "name": "执行工作流触发器",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        420,
        402
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "02e86bac-28df-493a-a32c-0310d62bdd59",
      "name": "设置目标URL值",
      "type": "n8n-nodes-base.set",
      "position": [
        620,
        402
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 3.4
    },
    {
      "id": "352ae1ee-3d99-4282-94be-b258e2929b58",
      "name": "获取目标网页",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        820,
        400
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "4e3ed4c0-88bb-48de-97f5-d95af77f5fd0",
      "name": "提取Turnstile站点密钥",
      "type": "n8n-nodes-base.code",
      "position": [
        1020,
        400
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "c95b46ec-f42d-463d-89c9-ad1c23462143",
      "name": "等待 30 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        1420,
        402
      ],
      "webhookId": "93571e3d-158b-4674-be6f-b57f0099375e",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "733cab5b-fa74-4bc8-a76d-908ab1624baa",
      "name": "创建验证码任务",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1220,
        400
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "9fdcbc00-21aa-4e6b-8a98-d8aaa05f2dbe",
      "name": "获取验证码解决方案",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1620,
        400
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "e877d8e4-5e02-43e8-9997-42aa532da92f",
      "name": "无操作 - 返回循环",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2000,
        542
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1bbc2b4d-3d50-4731-8372-8702edfc5ec7",
      "name": "引发runIndex错误",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        2220,
        402
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "98bcbd64-b443-4fd8-8e01-9a33e7fe7b12",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        600
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "f9e80add-bb12-479a-95e4-18fa25c6ef5f",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e7e3b6f6-ccc5-42a4-a1ab-90862fea7401",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        362
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "cb30271c-c963-40a6-b4b4-599ad8c7fe89",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        440,
        60
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "089464e5-16dd-4008-8408-5a37ab5d30e3",
      "name": "检查验证码状态",
      "type": "n8n-nodes-base.switch",
      "position": [
        1820,
        400
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "f4a6d929-b885-4176-8980-5011228e9dec",
      "name": "Puppeteer",
      "type": "n8n-nodes-puppeteer.puppeteer",
      "position": [
        880,
        60
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "12bbd971-1112-4abf-803a-cce62fa3d84b",
      "name": "使用2Captcha通过CF Turnstile检查",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        660,
        60
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "1161dd05-a426-4c4b-aece-89ec1160a5d6",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        -20
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "642676a6-eddc-41e7-8fbb-b19628de137a",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1820,
        1020
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "dee57826-ca00-425a-b328-0b31f43e2f4e",
  "connections": {
    "Wait 30 seconds": {
      "main": [
        [
          {
            "node": "Get Captcha Solution",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Captcha Task": {
      "main": [
        [
          {
            "node": "Wait 30 seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Captcha Status": {
      "main": [
        [],
        [
          {
            "node": "Raise runIndex error",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No operation - return loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Captcha Solution": {
      "main": [
        [
          {
            "node": "Check Captcha Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Workflow Trigger": {
      "main": [
        [
          {
            "node": "Set destination_url value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get destination web page": {
      "main": [
        [
          {
            "node": "Extract Turnstile Sitekey",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Turnstile Sitekey": {
      "main": [
        [
          {
            "node": "Create Captcha Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set destination_url value": {
      "main": [
        [
          {
            "node": "Get destination web page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No operation - return loop": {
      "main": [
        [
          {
            "node": "Wait 30 seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Pass CF Turnstile check using 2Captcha",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pass CF Turnstile check using 2Captcha": {
      "main": [
        [
          {
            "node": "Puppeteer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 工程, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量18
分类2
节点类型12
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Ludwig

Ludwig

@ludwig

If you have any questions about any of the templates I've built, please reach out to me on LinkedIn (https://www.linkedin.com/in/ludwiggerdes) or via my website down below. 👇

外部链接
在 n8n.io 查看

分享此工作流