从主页获取数据到 NodeRed (HighCharts)

Get data to NodeRed from Homepage (HighCharts)

我想使用 node-red 从此图表中提取数据:

http://fiskdata.se/raknare/live/live.php?locationId=109 该图表标有 "Preliminära resultat 2018",我想要绿色和红色系列。我想在我的家庭自动化中收到警报并趋势水流和温度。

在红色节点中,我使用的是 "http request node" -> "html node" -> "function" -> "Debug".

我的问题是: 我应该在 "html node" 中使用什么选择器?我试图通过 web developer in firefox 针对该网页解决它,但我不明白它。

我的函数将这两个系列转换为节点红色的数组会是什么样子? value/date.

的两个系列

Image for Node_red Code

以下说明将告诉您如何在网页上找到获取图表背后数据的url: https://onlinejournalismblog.com/2017/05/10/how-to-find-data-behind-chart-map-using-inspector/

使用这些说明,我认为对于您在问题中提到的页面,它将类似于:

  1. http://fiskdata.se/raknare/live/ajax/liveChart.php?counterId=232
  2. http://fiskdata.se/raknare/report/ajax/ackNettoChart.php?counterId=232&exportWidth=500&exportHeight=281&disableHeader=0&english=0

因此,在 node-red 中,您可以创建一个流,其中包含一个 inject 节点,一个 html in 节点使用上述 2 个 URL 之一和一个或多个节点解析 html in 节点的输出。

韩语 一月