# Html parse value

**URL:** <https://discourse.nodered.org/t/html-parse-value/53916>\
**Category:** General\
**Created:** [17 November 2021 22:12 UTC](https://discourse.nodered.org/t/html-parse-value/53916 "2021-11-17T22:12:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![steinerma](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steinerma/32/37666_2.png) [@steinerma](https://discourse.nodered.org/u/steinerma)\
**Post date:** [17 November 2021 22:12 UTC](https://discourse.nodered.org/t/html-parse-value/53916/1 "2021-11-17T22:12:20Z")

</div>

Hi,  
I would like to parse the value of the frequency ( **currently 50.011 Hz** ) from the website [https://www.netzfrequenz.info/](https://www.netzfrequenz.info/). Unfortunately I don't have a idea how to do that.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/7/67cbc3a736016af46f8d5fde06a422119372139c.png)

I have set the following:  
Do you have a hint what I have to set?  
i have a guess that i have chosen a wrong selector

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/0/40e77fe75616aeaa3431194f88e9d0e8d1255b2c.png)

here the whole flow

```auto
[{"id":"3ab27a41.60baa6","type":"inject","z":"dbd92bb5.58bb68","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":270,"y":580,"wires":[["6f88489b.7f3f88"]]},{"id":"6f88489b.7f3f88","type":"http request","z":"dbd92bb5.58bb68","name":"https://www.netzfrequenz.info/","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://www.netzfrequenz.info/","tls":"","persist":false,"proxy":"","authType":"","x":520,"y":580,"wires":[["75d0dac2.a64df4","c259c87fb199432a"]]},{"id":"6957b0.d583785","type":"switch","z":"dbd92bb5.58bb68","name":"Inhalt testen","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"Aktuelle Netzfrequenz","vt":"str","case":true},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1130,"y":480,"wires":[["56293aaf9df4bbae"],[]]},{"id":"75d0dac2.a64df4","type":"html","z":"dbd92bb5.58bb68","name":"Text suchen","property":"payload","outproperty":"payload","tag":"#frequenz","ret":"text","as":"multi","x":880,"y":480,"wires":[["6957b0.d583785","e5e53dea916dc3cf"]]},{"id":"56293aaf9df4bbae","type":"debug","z":"dbd92bb5.58bb68","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1400,"y":460,"wires":[]},{"id":"e5e53dea916dc3cf","type":"debug","z":"dbd92bb5.58bb68","name":"TEST FREQUENZ","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1160,"y":400,"wires":[]},{"id":"c259c87fb199432a","type":"debug","z":"dbd92bb5.58bb68","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":880,"y":640,"wires":[]}]

```

thanks a lot for your help!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [17 November 2021 22:20 UTC](https://discourse.nodered.org/t/html-parse-value/53916/2 "2021-11-17T22:20:47Z")

</div>

that looks like a rather dynamic page so will be hard to parse - but if you dig in quite a way you can find that it is actually this url you need to request - [https://www.netzfrequenz.info/json/act.json](https://www.netzfrequenz.info/json/act.json)

---

<div class="post-metadata">

**Author:** ![steinerma](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steinerma/32/37666_2.png) [@steinerma](https://discourse.nodered.org/u/steinerma)\
**Post date:** [17 November 2021 22:25 UTC](https://discourse.nodered.org/t/html-parse-value/53916/3 "2021-11-17T22:25:28Z")

</div>

Wow great - thank you so much!!! So it works perfectly!

Is there also a json object for this page? [Aktuelle Netzkennzahlen](https://www.swissgrid.ch/de/home/operation/grid-data/current-data.html)

---

<div class="post-metadata">

**Author:** ![steinerma](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steinerma/32/37666_2.png) [@steinerma](https://discourse.nodered.org/u/steinerma)\
**Post date:** [18 November 2021 05:27 UTC](https://discourse.nodered.org/t/html-parse-value/53916/4 "2021-11-18T05:27:04Z")

</div>

Please excuse my imprecise question. Is there also a way to read out the marked value (currently 49.987 Hz) with JSON? That would be great

Website: [Aktuelle Netzkennzahlen](https://www.swissgrid.ch/de/home/operation/grid-data/current-data.html)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0cb57dde894deba468a7419733335f043c8b511f.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [18 November 2021 08:18 UTC](https://discourse.nodered.org/t/html-parse-value/53916/5 "2021-11-18T08:18:20Z")

</div>

The data seems to be from [https://www.swissgrid.ch/bin/services/apicache?path=/content/swissgrid/de/home/operation/grid-data/current-data/jcr:content/parsys/chart\_copy](https://www.swissgrid.ch/bin/services/apicache?path=/content/swissgrid/de/home/operation/grid-data/current-data/jcr:content/parsys/chart_copy)  
which is a complete json object for the chart and data.

---

<div class="post-metadata">

**Author:** ![steinerma](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steinerma/32/37666_2.png) [@steinerma](https://discourse.nodered.org/u/steinerma)\
**Post date:** [18 November 2021 12:24 UTC](https://discourse.nodered.org/t/html-parse-value/53916/6 "2021-11-18T12:24:24Z")

</div>

That's great! thank you very, very much!  
One last question: where do you get the information from the source code?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [18 November 2021 12:53 UTC](https://discourse.nodered.org/t/html-parse-value/53916/7 "2021-11-18T12:53:49Z")

</div>

In both cases I used the browser dev tools window to look at the network tab to see the live traffic  
eg

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/c/2ccc8441728ad89f884aca2d92d743cbe2d2f1b6.png)  
Then looked at the url they were constantly reloading...

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 December 2021 12:54 UTC](https://discourse.nodered.org/t/html-parse-value/53916/8 "2021-12-02T12:54:10Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
