Scraping date from NX Alarme ( Web Server)

21 views
Skip to first unread message

434cond...@gmail.com

unread,
Apr 20, 2018, 9:05:51 AM4/20/18
to Node-RED
Hello All

I would appreciate this group support for the following,

I intend to retrieve data from my alarm in order to use the wired sensors data. ( i already manage to arm and disarm with some basic POST )


What I need i ho to capture the following info

<h2> for the different class boxes


looking for your support

thank you

José Godinho
NX_595E_Secure_Network.png

Mark Setrem

unread,
Apr 20, 2018, 9:19:24 AM4/20/18
to Node-RED
You can use the standard html node and filter it to grab the specific part you want.The nodes info explains what to do

steve rickus

unread,
Apr 20, 2018, 9:20:32 AM4/20/18
to Node-RED
So your alarm hardware has a built-in web server that generates that html page, and you want to grab parts of the page as data? Have you searched in the flows library yet?

I know of at least two contrib nodes that can do what you want, node-red-contrib-cheerio (for parsing xml/html structured text), and node-red-contrib-string (more general string searching based on markers). It sounds like the first one is best for your use case. Use an http request node to get the page contents from the url, and wire that into the cheerio node.

Of course, you will need a node to tell the http request node when to pull the page from the alarm system. If you are simply trying to show status on a dashboard, you can use the ui_control node to detect whenever that dashboard page is loaded and read the alarm page at that moment. But if you are trying to monitor the alarm, you could use an inject node set to poll the alarm page every X seconds.
--
Steve

434Cond...@gmail.com

unread,
Apr 20, 2018, 9:31:27 AM4/20/18
to Node-RED
hello I have done that, but I cannot retrieve it

434Cond...@gmail.com

unread,
Apr 20, 2018, 9:32:50 AM4/20/18
to Node-RED

Steve

Thank you I will take a look in the cheerio.

Thank you

Nick O'Leary

unread,
Apr 20, 2018, 9:35:36 AM4/20/18
to Node-RED Mailing List
The core HTML node uses cheerio under the covers - you should not need to use a contrib node for this.

If you want to share what you have actually tried so far, we may be able to guide you. Just saying 'it doesn't work' doesn't allow us to help.

Nick

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/ccf75000-9317-4e82-be39-ded59b977c91%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

steve rickus

unread,
Apr 20, 2018, 10:01:04 AM4/20/18
to Node-RED
Ah, good to know -- i've not used either for screen scraping yet, but it makes more sense to use the core node if possible...

434Cond...@gmail.com

unread,
Apr 20, 2018, 10:07:43 AM4/20/18
to Node-RED
Hello Nick

I am  mechanical eng., I  have learned in the pre Web.., so this things of html CCS is completly strange

Albeit i have very fond of node red and  currently i am acting as a node red proselyte, annoying all my friend how fantastic this is .

The current issue I have 


Having the following snippet from a long HTML , i would like to retrieve the different h1 and h3 for each box ( a0 to a3) - how i link  this in the HTLM node?




<div id="at" class="main"><div id="a0" class="box"><h1 class="bg-grn">Todas as Partições</h1>         <h2>Sem falhas</h2>  ....
......
>                                              <div id="a3" class="box"><h1 class="bg-grn">Corredor 1. Andar</h1>         <h2>Pronto</h2>         <button type="button" class="ba bg-gry" 

Thank you

Godinho
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
Reply all
Reply to author
Forward
0 new messages