How to get a value of an HTML page

Hi,

I want to get a VALUE of an element of a (local) HTML page

The element in the HTML page is
<p id="stbStatus"> VALUE </p>

image

I tried a lot of possiblities but I can't figure out what I need to fill in at the Selector field, to get this value?
Selector value h1 is working, but that is not the one I need

You need to know how to use selectors. Read this

Note: it is possible that the value is dynamically updated by JavaScript after the page loads therefore may not be in the Dom. See how you get on.

Thanx for the quick answer! Yes it is dynamically updated.

I will have a look

Read this recent thread it might be of use for you.

I figured out that with an HttpRequest node it is not possible to get the value, because it is populated each second by a JavaScript function.

Let me get more specific of what I want to achieve.
I have a Setopbox (STB) device that I want to communicate with via node-red.
On Github I have found a simple webinterface of this STB.

I have cloned this (and installed the npm requirements) on the same local machine (RPi) as Node-Red.
I can access the web interface at: http://192.168.1.51:8080

With an HttpRequest Node I managed to Toggle On/Off, but getting the Status (On, Off, Paused) is not possible with this Node.

But when I check the "index.js" file, I see that communication takes place via an external mqtt server.
The difficulty is that Username, Password and ClientID for the mqtt server are not static.
They are generated (each session) from a combination of different "const" values.

Which approach would you recommend, with my limited javascript knowledge?

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