# Get a value from website

**URL:** https://discourse.nodered.org/t/get-a-value-from-website/11043
**Category:** General
**Created:** [12 May 2019 15:40 UTC](https://discourse.nodered.org/t/get-a-value-from-website/11043 "2019-05-12T15:40:21Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![HaVi](https://avatars.discourse-cdn.com/v4/letter/h/b3f665/32.png) [@HaVi](https://discourse.nodered.org/u/HaVi)
#### Post date: [12 May 2019 15:40 UTC](https://discourse.nodered.org/t/get-a-value-from-website/11043/1 "2019-05-12T15:40:21Z")

</div>

Hi,

I want to use a value from a website to write it in my Influx database. The HTTP-request URL I use in Node-RED is [https://waterinfo.rws.nl/#!/details/publiek/waterhoogte-t-o-v-nap/Tiel-Waal(TIEW)/Waterhoogte\_\_\_20Oppervlaktewater\_\_\_20t.o.v.\_\_\_20Normaal\_\_\_20Amsterdams\_\_\_20Peil\_\_\_20in\_\_\_20cm](https://waterinfo.rws.nl/#!/details/publiek/waterhoogte-t-o-v-nap/Tiel-Waal(TIEW)/Waterhoogte ___20Oppervlaktewater___ 20t.o.v. ___20Normaal___ 20Amsterdams ___20Peil___ 20in___20cm) and I intend to use the value behind "Laatste meting:" in a payload to feed the database. Can someone help me how to setup the HTML node to extract this value?

Thanks, Hans.

 ![Node-RED](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4b0fc489a6b560aa6f8d20c6ff1a310a1f86f687.png)

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [12 May 2019 16:19 UTC](https://discourse.nodered.org/t/get-a-value-from-website/11043/2 "2019-05-12T16:19:36Z")

</div>

The nice thing about this website, is that the graph is actually loaded via an XHR object, the json can be read directly in node-red.

Try this flow:

```auto
[{"id":"e422b0bb.0be0d8","type":"inject","z":"7ff1daca.703a14","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":148,"y":176,"wires":[["e2d79a7e.da52c"]]},{"id":"e2d79a7e.da52c","type":"http request","z":"7ff1daca.703a14","name":"","method":"GET","ret":"obj","paytoqs":false,"url":"https://waterinfo.rws.nl/api/detail?expertParameter=Waterhoogte ___20Oppervlaktewater___ 20t.o.v. ___20Normaal___ 20Amsterdams ___20Peil___ 20in___20cm&locationSlug=Tiel-Waal%28TIEW%29&user=publiek","tls":"","proxy":"","authType":"basic","x":334,"y":176,"wires":[["e3363609.37dbe","b95c765e.65ff"]]},{"id":"e3363609.37dbe","type":"debug","z":"7ff1daca.703a14","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":642,"y":88,"wires":[]},{"id":"b95c765e.65ff","type":"debug","z":"7ff1daca.703a14","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.latest.data","targetType":"msg","x":682,"y":220,"wires":[]}]

```

---

<div class="post-metadata">

### Author: ![HaVi](https://avatars.discourse-cdn.com/v4/letter/h/b3f665/32.png) [@HaVi](https://discourse.nodered.org/u/HaVi)
#### Post date: [12 May 2019 16:35 UTC](https://discourse.nodered.org/t/get-a-value-from-website/11043/3 "2019-05-12T16:35:53Z")

</div>

Hi,

As a Node-RED newbie I have spend a few frustrating hours to do this, without succes. Your flow works without and further editing so you make me happy, thanks for helping!

Best regards, Hans.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [12 May 2019 16:45 UTC](https://discourse.nodered.org/t/get-a-value-from-website/11043/4 "2019-05-12T16:45:08Z")

</div>

The problem is (I believe) the graph is shown/loaded via javascript, so when you get it via node-red, the panel is not loaded and you cannot extract the data.

Use the web inspector in a browser, look at the "resources" tab and reload the page, you will see the documents it is loading, a couple of XHR files as well, which contain the data you are looking for (many websites work like this, can come in helpful).

---

<div class="post-metadata">

### Author: ![HaVi](https://avatars.discourse-cdn.com/v4/letter/h/b3f665/32.png) [@HaVi](https://discourse.nodered.org/u/HaVi)
#### Post date: [12 May 2019 17:02 UTC](https://discourse.nodered.org/t/get-a-value-from-website/11043/5 "2019-05-12T17:02:29Z")

</div>

My garden borders on a lake where I sail, so I measure the water level with a TTN LoRa node. This works well with NodeRED, InfluxDB and Grafana. Because my house is situated in the river area of the Netherlands, between the two large rivers Waal and Rijn, I want to know the influence of the water level in those rivers on the water level in the lake. The water level of the two rivers are publicly available and I can now request and process them with your flow. I appreciate your help and explanation!

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [12 May 2019 17:32 UTC](https://discourse.nodered.org/t/get-a-value-from-website/11043/6 "2019-05-12T17:32:47Z")

</div>

We willen geen overstromingen! 😉
