Data from JS function

We have an industrial compressor in our plant that has a LAN port. I plugged it in and can view the operating data on a simple webpage via our local network. I inspected the page and found it uses JS functions. I am interested in obtaining the data from the first function highlighted below.

I pasted what I believed was the function into the HTTP GET box and unfortunately could not get any result. See below. I believe this should be a straightforward request, but I know almost nothing about executing a JS function in Node-RED. Maybe I should be using a Function node with the IP address specified somewhere? Any help is greatly appreciated.

Still trying to obtain the value from an HTML table. It appears the Cheerio node may be the best tool for this, but before I start down that path, maybe someone could look at what I am seeing below and chime in. The value that I am after is 54 C (and of course this changes dynamically, so if I check in a few minutes from now it will be different).

The problem you likely have is data is not present in the html - it will be dynamically added by the sites scripts.

You cannot simply http request to a script. I could explain but if have to explain quite a lot of concepts.

You have 2 possibilities I can see (there is a 3rd involving puppeteer or similar but it's a hack)

Best option...
If the source data comes from a copco device, it likely supports open protocol - you can get the values from the controller directly.

Alternatively, use the Devtools, look in the network tab see if you can determine if there is a http call to the backend where the values are retrieved.

1 Like