8
n8n 中文网amn8n.com

解析Ycombinator新闻页面

中级

这是一个Other领域的自动化工作流,包含 8 个节点。主要使用 Merge, EmailSend, ItemLists, HtmlExtract, HttpRequest 等节点。 解析Ycombinator新闻页面

前置要求
  • 可能需要目标 API 的认证凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移

无法加载工作流预览

导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "nodes": [
    {
      "name": "点击“执行”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -100,
        470
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "name": "HTTP 请求",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Get news page",
      "position": [
        100,
        470
      ],
      "parameters": {
        "url": "=https://news.ycombinator.com/",
        "options": {
          "fullResponse": true,
          "batchInterval": 500
        },
        "responseFormat": "file",
        "queryParametersUi": {
          "parameter": []
        },
        "headerParametersUi": {
          "parameter": []
        },
        "allowUnauthorizedCerts": true
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "name": "HTML 提取",
      "type": "n8n-nodes-base.htmlExtract",
      "notes": "extract news data",
      "position": [
        310,
        470
      ],
      "parameters": {
        "options": {},
        "sourceData": "binary",
        "extractionValues": {
          "values": [
            {
              "key": "news_title",
              "cssSelector": ".storylink",
              "returnArray": true
            },
            {
              "key": "news_url",
              "attribute": "href",
              "cssSelector": ".storylink",
              "returnArray": true,
              "returnValue": "attribute"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "name": "列出新闻网址",
      "type": "n8n-nodes-base.itemLists",
      "position": [
        500,
        570
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "news_url"
      },
      "typeVersion": 1
    },
    {
      "name": "列出新闻标题",
      "type": "n8n-nodes-base.itemLists",
      "position": [
        500,
        390
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "news_title"
      },
      "typeVersion": 1
    },
    {
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        700,
        470
      ],
      "parameters": {
        "mode": "mergeByIndex"
      },
      "typeVersion": 1
    },
    {
      "name": "电子表格文件",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        870,
        470
      ],
      "parameters": {
        "options": {
          "fileName": "=Ycombinator_news_{{new Date().toISOString().split('T', 1)[0]}}.{{$parameter[\"fileFormat\"]}}",
          "sheetName": "Latest news"
        },
        "operation": "toFile"
      },
      "typeVersion": 1
    },
    {
      "name": "发送邮件通知",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1050,
        470
      ],
      "parameters": {
        "text": "=Here are the latest news attached!",
        "options": {},
        "subject": "Ycombinator news",
        "toEmail": "",
        "fromEmail": "",
        "attachments": "data"
      },
      "credentials": {
        "smtp": ""
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Spreadsheet File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML Extract": {
      "main": [
        [
          {
            "node": "list news title",
            "type": "main",
            "index": 0
          },
          {
            "node": "list news url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "HTML Extract",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "list news url": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "list news title": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Spreadsheet File": {
      "main": [
        [
          {
            "node": "Send email notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 其他

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流