I like to have a value from a internetpage. The downloades html is 60K file which has to be parsed for a certain position, then a value some lines futher down has to become an item in Openhab2.
I read the wiki of the HTTP Binding and some other stuff I found on the net, but I don’t get a clue how to parse the html to get the specific value out.
The html contains some parts similiar to that below. The word “Tihange” makes the part unique I like to parse out.
var canvas = document.getElementById('Tihange');
var data = {
labels: ["TDRM4", "TDRM10", , , , ],
datasets: [
{
label: string_current,
backgroundColor: "rgba(153,204,255,1.0)",
borderColor: "rgba(153,204,255,1)",
borderWidth: 2,
hoverBackgroundColor: "rgba(153,204,255,1)",
hoverBorderColor: "rgba(153,204,255,1)",
data: [0.191, 0.197, ],
},
{
label: string_max,
backgroundColor: "rgba(153,255,0,0.7)",
borderColor: "rgba(153,255,0,1)",
borderWidth: 2,
hoverBackgroundColor: "rgba(153,255,0,0.4)",
hoverBorderColor: "rgba(153,255,0,1)",
data: [0.224, 0.217, ],
},
I like to have the 0.224 behind the “data:[” to be in an Item of Openhab2.
Is there anybody out there who can code that or point me in the right direction?
I know, this question is a bit to much, but maybe someone has something similar allready in his/her portfolio?
Thanks,
Ingo