8
n8n 中文网amn8n.com

使用Bright Data Web Unlocker捕获网站截图并保存到磁盘

中级

这是一个Design, IT Ops领域的自动化工作流,包含 6 个节点。主要使用 Set, HttpRequest, ManualTrigger, ReadWriteFile 等节点。 使用Bright Data Web Unlocker捕获网站截图并保存到磁盘

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "1U5Jf4NMQEw9LtxY",
  "meta": {
    "instanceId": "885b4fb4a6a9c2cb5621429a7b972df0d05bb724c20ac7dac7171b62f1c7ef40"
  },
  "name": "使用 Bright Data Web Unlocker 捕获网站截图并保存到磁盘",
  "tags": [
    {
      "id": "Kujft2FOjmOVQAmJ",
      "name": "Engineering",
      "createdAt": "2025-04-09T01:31:00.558Z",
      "updatedAt": "2025-04-09T01:31:00.558Z"
    }
  ],
  "nodes": [
    {
      "id": "d61cb066-1d5f-47d5-a4dd-4534f3d3c6d8",
      "name": "点击“测试工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -520,
        -160
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "eb99305b-0375-4cdd-8682-637d281598a0",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -540,
        -500
      ],
      "parameters": {
        "width": 360,
        "height": 260,
        "content": "## 注意"
      },
      "typeVersion": 1
    },
    {
      "id": "205f64e9-5b31-4c76-912a-307eccde159e",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -240
      ],
      "parameters": {
        "color": 4,
        "width": 260,
        "height": 280,
        "content": "## 网站截图"
      },
      "typeVersion": 1
    },
    {
      "id": "e7705941-2ae8-4c38-93cb-2cb865314872",
      "name": "将文件写入磁盘",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        140,
        -160
      ],
      "parameters": {
        "options": {},
        "fileName": "={{ \"c:\\\\\"+ $json.filename }}",
        "operation": "write",
        "dataPropertyName": "={{ $json.filename }}"
      },
      "typeVersion": 1
    },
    {
      "id": "167ff255-da5b-43c1-a22f-e00c4cc166d8",
      "name": "捕获截图",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -80,
        -160
      ],
      "parameters": {
        "url": "https://api.brightdata.com/request",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "={{ $json.filename }}"
            }
          },
          "allowUnauthorizedCerts": true
        },
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "zone",
              "value": "={{ $json.zone }}"
            },
            {
              "name": "url",
              "value": "={{ $json.url }}"
            },
            {
              "name": "format",
              "value": "raw"
            },
            {
              "name": "data_format",
              "value": "screenshot"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "kdbqXuxIR8qIxF7y",
          "name": "Header Auth account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1c5c3d72-f20d-4d06-a6f2-461d043c4a01",
      "name": "设置 URL、文件名和 Bright Data 区域",
      "type": "n8n-nodes-base.set",
      "position": [
        -300,
        -160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c9de0c3e-609a-4e87-b6ab-b4312be026a9",
              "name": "url",
              "type": "string",
              "value": "https://dev.to/"
            },
            {
              "id": "408ed65a-0d66-4f98-b2eb-0d5e066e3250",
              "name": "filename",
              "type": "string",
              "value": "devto.png"
            },
            {
              "id": "ee10fcb0-a610-4987-8a4e-dfab077aee0e",
              "name": "zone",
              "type": "string",
              "value": "web_unlocker1"
            }
          ]
        }
      },
      "typeVersion": 3.4
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d3ae63f2-efcf-478b-aadf-8a3fac2af02a",
  "connections": {
    "Capture a screenshot": {
      "main": [
        [
          {
            "node": "Write a file to disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Set URL, Filename and Bright Data Zone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set URL, Filename and Bright Data Zone": {
      "main": [
        [
          {
            "node": "Capture a screenshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 设计, IT 运维

需要付费吗?

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

工作流信息
难度等级
中级
节点数量6
分类2
节点类型5
难度说明

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

外部链接
在 n8n.io 查看

分享此工作流