S
S
shadrap2019-05-22 18:55:46
HTML
shadrap, 2019-05-22 18:55:46

Need to decide on the structure of an unknown html page?

Hello, there is a device that raises its mini web (monitor of energy and temperature). On the web page of the device ip_address/energy I see such an array

energy|{"Ts":"380158","Va":"232.00","Aa":"0.37","Pa":"56","PFa":"0.65","T0":"18.94"}|div

in fact, it represents everything that is on the page. What is this structure? JSON - doesn't look like .
Is it possible to create an http link that reads some of the parameters of this array, a string?
What would be a direct link pointing to the value ?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2019-05-22
@shadrap

var s = 'energy|{"Ts":"380158","Va":"232.00","Aa":"0.37","Pa":"56","PFa":"0.65","T0":"18.94"}|div';
s = s.split('|');
s[1] = JSON.parse(s[1]);
console.log(s);
console.log(s[1].Va); //232.00

Accordingly, the link for you will be something like this (should return 232.00):
Only it is not clear what kind of problem you have, which means that a normal solution cannot be offered.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question