HTML-parse extract value from javascript

Hello there,

once again I have a flow to read values from my Heating-Systems Web-UI an puts the data into an SQL-DB. First part to the problem was solved by @E1cid (thank you again) here: html-parce-to-sql-flow-optimization

Unfortunately there are other pages with different structure, where the desired values are not in the plain HTML.
The HTML look like:

  <div class="span-7 ialigned">
    <h3 class="title">RAUMTEMP. NACHT</h3>
  </div>
  <div class="values span-7">
    <div class="editors">
      <a onmousedown="change('val7','+',10,30,'0.1',true);return false;" href="javascript://">
        <img src="./pics/button_higher.png">
      </a>
      <a id="editorslower" onmousedown="change('val7','-',10,30,'0.1',true);return false;" href="javascript://" style="clear:left;">
        <img src="./pics/button_lower.png">
      </a>
    </div> 
    <input type="text" tabindex="2" value="" name="val7" id="val7" class="edit upndown" style="width:3.6em">
	
    <script language="javascript" type="text/javascript">
      valSettings['val7'] = new Array();
      valSettings['val7']['type'] = 'float';       valSettings['val7']['min'] = '10';
      valSettings['val7']['max'] = '30';
      
            
      jsvalues['7'] = new Array();
      jsvalues['7']['id']='val7';
      jsvalues['7']['val']='21,5';
    </script>
   </div>
  <div class="values span-1 append-1">°C</div>
  <div class="green round-right span-8 last">
    <p>Gültige Werte: Eingabe zwischen<br />10 °C und 30 °C</p>
  </div>
  </div>  <div class="calibration round span-24 last" id="calval58">

I want to get "RAUMTEMP. NACHT" and the corresponding Value "21,5".

My current try looks like:

[
    {
        "id": "092ceda1e64fd139",
        "type": "html",
        "z": "cb085eef1cd8e696",
        "name": "",
        "property": "payload",
        "outproperty": "payload",
        "tag": "script.val, .title",
        "ret": "text",
        "as": "single",
        "x": 400,
        "y": 320,
        "wires": [
            [
                "83830f8dcc177657",
                "e1b27dd0d724abbc"
            ]
        ]
    },
    {
        "id": "83830f8dcc177657",
        "type": "function",
        "z": "cb085eef1cd8e696",
        "name": "parse http",
        "func": "const output = {};\nfor(let i = 0; i < msg.payload.length; i += 2){\n    let value = parseFloat(msg.payload[i+1].replace(\",\", \".\"))\n    if(isNaN(value)) value = 0;\n    let key = msg.payload[i].replace(/[^A-Za-z0-9]+/g,\" \").trim().replace(/\\s/g, \"_\");\n    output[key] = value\n}\n\nmsg.payload = output;\n\nmsg.topic = \"task8\";\n\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 560,
        "y": 320,
        "wires": [
            [
                "199c9a19fd72d8bb",
                "bec8eab33bfc6b0c"
            ]
        ]
    },
    {
        "id": "7519ac97c48ffcc9",
        "type": "http request",
        "z": "cb085eef1cd8e696",
        "name": "LWZ",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "192.168.2.120/?s=4,0",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 230,
        "y": 320,
        "wires": [
            [
                "092ceda1e64fd139",
                "690670859ec91b41"
            ]
        ]
    }
]

With that I get the "titles" quite well but I couldn't manage to get the value :man_bowing:

If someone is willing to help me any advice is highly appreciated. :slightly_smiling_face:

Best Regards
Michael

You could use JSONata to find the substring section
e.g.

[{"id":"5043d3d9928e476d","type":"inject","z":"b779de97.b1b46","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":2660,"wires":[["3619501058a5b350"]]},{"id":"3619501058a5b350","type":"template","z":"b779de97.b1b46","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<div class=\"span-7 ialigned\">\n    <h3 class=\"title\">RAUMTEMP. NACHT</h3>\n  </div>\n  <div class=\"values span-7\">\n    <div class=\"editors\">\n      <a onmousedown=\"change('val7','+',10,30,'0.1',true);return false;\" href=\"javascript://\">\n        <img src=\"./pics/button_higher.png\">\n      </a>\n      <a id=\"editorslower\" onmousedown=\"change('val7','-',10,30,'0.1',true);return false;\" href=\"javascript://\" style=\"clear:left;\">\n        <img src=\"./pics/button_lower.png\">\n      </a>\n    </div> \n    <input type=\"text\" tabindex=\"2\" value=\"\" name=\"val7\" id=\"val7\" class=\"edit upndown\" style=\"width:3.6em\">\n\t\n    <script language=\"javascript\" type=\"text/javascript\">\n      valSettings['val7'] = new Array();\n      valSettings['val7']['type'] = 'float';       valSettings['val7']['min'] = '10';\n      valSettings['val7']['max'] = '30';\n      \n            \n      jsvalues['7'] = new Array();\n      jsvalues['7']['id']='val7';\n      jsvalues['7']['val']='21,5';\n    </script>\n   </div>\n  <div class=\"values span-1 append-1\">°C</div>\n  <div class=\"green round-right span-8 last\">\n    <p>Gültige Werte: Eingabe zwischen<br />10 °C und 30 °C</p>\n  </div>\n  </div>  <div class=\"calibration round span-24 last\" id=\"calval58\">","output":"str","x":300,"y":2660,"wires":[["55d71dd56580667b"]]},{"id":"55d71dd56580667b","type":"html","z":"b779de97.b1b46","name":"","property":"payload","outproperty":"temp","tag":"h3","ret":"text","as":"single","x":450,"y":2660,"wires":[["66d6156943dfacf6"]]},{"id":"66d6156943dfacf6","type":"change","z":"b779de97.b1b46","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$substringBefore($substringAfter($$.payload, \"svalues['7']['val']='\"),\"'\")","tot":"jsonata"},{"t":"move","p":"payload","pt":"msg","to":"payload.temp","tot":"msg"},{"t":"move","p":"temp[0]","pt":"msg","to":"payload.title","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":2660,"wires":[["387675af5fa81414"]]},{"id":"387675af5fa81414","type":"debug","z":"b779de97.b1b46","name":"debug 299","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":450,"y":2600,"wires":[]}]