如何在 Node-red 中抓取网站

How to scrape websites in Node-red

我需要用 Node-red 抓取一个网站,但我不确定应该怎么做。

我知道如何在 Google 电子表格中抓取网站,但我不知道如何对 node-red 中的 html 节点执行相同的操作。

这是我在 Google 电子表格中使用的:

=index(importxml("https://www.website.dom";"//h2[@class='item-title']");1)

您可以使用HTTP Request节点获取页面内容,然后使用HTML节点提取您感兴趣的部分。

食谱在此处包含一个示例食谱:https://cookbook.nodered.org/http/simple-get-request