Extracting data from web page

Hallo all,
I have been trying to get a value from an extranal webpage with the http request node. I just dont seem to get it working. I dont understand how to get the correct url from the web page.

can you please help?

You obviously already know the URL (as you are looking at the page src)

Do you mean you dont know how to get specific the data from the page into node-red?

What have you tried so far?

HI steve, thanks for your reply. I have the info in front of me but I don't exactly understand fow to filter down to the variable I need. If I get a little help to grasp the concept I think I will be on my way.

[{"id":"a2b07ec9.73957","type":"inject","z":"ae9889c1.d28c78","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":640,"wires":[["ca3e73c1.fc47d"]]},{"id":"ca3e73c1.fc47d","type":"http request","z":"ae9889c1.d28c78","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://duco001/boxinfo.html","tls":"","persist":false,"proxy":"","authType":"","x":470,"y":640,"wires":[["ad4f898b.d61258","979c94ca.eea358"]]},{"id":"ad4f898b.d61258","type":"debug","z":"ae9889c1.d28c78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1030,"y":640,"wires":[]},{"id":"3cac8f4.795947","type":"debug","z":"ae9889c1.d28c78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1030,"y":700,"wires":[]},{"id":"979c94ca.eea358","type":"html","z":"ae9889c1.d28c78","name":"","property":"payload","outproperty":"payload","tag":"div.boxinfotable1>table>tbody>tr>td","ret":"text","as":"single","x":780,"y":700,"wires":[["3cac8f4.795947"]]}]

It is entirely possible the values are NOT in the HTML but are "added" to the page via JavaScript

Try writing the contents of the http request payload to a file - is the value you want inside the file?

If not, then open devtools, select the network tab & refresh the page - you will see several (or many) requests to other data sources & the value you want might be in one of those. With any luck, it will be in a JSON response - then you can user that URL instead of the webpage.

Amazing, just like you said. I could find the values in a JSON file. It's working, thanks so much!

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