# Get value from local webpage

**URL:** <https://discourse.nodered.org/t/get-value-from-local-webpage/26324>\
**Category:** General\
**Created:** [8 May 2020 18:44 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324 "2020-05-08T18:44:28Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@nick](https://discourse.nodered.org/u/nick)\
**Post date:** [8 May 2020 18:44 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/1 "2020-05-08T18:44:28Z")

</div>

Hi all,  
i have a local network with a device that has a webpage to show some status value's of it.  
now am i trying to get that information to a raspberry pi using node red.  
in the pictures below you will find the code of the webpage and my flow in node red.  
i am trying to get the value of miv1, but when i try to get it i read empty.  
can someone tell me what i am doing wrong?

 ![20200508_165331](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/7/475aba5879bc6e905acdcedbc742d2b4eba18d9b.jpeg) ![20200508_164115](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/a/7a623bacf6d6c2436d0392a4e5b0af4f9f9bcc2c.jpeg)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 May 2020 18:52 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/2 "2020-05-08T18:52:28Z")

</div>

Hi couple of things...

Why are you taking a photo and not just screen a shot? Photos always look awful (and they are large)

Its hard to tell as you haven't posted your flow or sample data.

Put a debug node (set to show complete message) after the http request node - is the data you expect in the output? Are you getting status code 200?

Are you using a CSS selector `#miv1` in the html node?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 May 2020 19:05 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/3 "2020-05-08T19:05:12Z")

</div>

This is how I do a test

- create a local web page in node red containing a `div` with `id="miv1"`
- run my http request against the known local data to test it all works
- then try to connect to an external / lan device

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/b/eb40e267a413256b126c6c5be554139d7ed66eb3.png)

test flow...

```auto
[{"id":"b31cdea8.7916b","type":"inject","z":"2f34ec3.705a014","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":420,"y":280,"wires":[["9f75405d.959c9"]]},{"id":"9f75405d.959c9","type":"http request","z":"2f34ec3.705a014","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"http://localhost:1880/test","tls":"","persist":false,"proxy":"","authType":"","x":590,"y":280,"wires":[["a6ac84c.fc16878","f5d1f4c1.a69ab8"]]},{"id":"a6ac84c.fc16878","type":"html","z":"2f34ec3.705a014","name":"","property":"payload","outproperty":"payload","tag":"#miv1","ret":"text","as":"single","x":790,"y":280,"wires":[["d7089051.909de"]]},{"id":"f5d1f4c1.a69ab8","type":"debug","z":"2f34ec3.705a014","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":710,"y":340,"wires":[]},{"id":"d7089051.909de","type":"debug","z":"2f34ec3.705a014","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":950,"y":280,"wires":[]},{"id":"4391b0c3.4df86","type":"http in","z":"2f34ec3.705a014","name":"","url":"/test","method":"get","upload":false,"swaggerDoc":"","x":420,"y":140,"wires":[["101a3909.f68d47"]]},{"id":"101a3909.f68d47","type":"template","z":"2f34ec3.705a014","name":"","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"<html>\n <head>\n <title>Test page</title>\n </head>\n <body>\n <h1>Welcome</h1>\n <div id=\"miv1\">hi there</div>\n </body>\n</html>","output":"str","x":580,"y":140,"wires":[["e8d67376.d2d08","f1323014.0ada3"]]},{"id":"e8d67376.d2d08","type":"http response","z":"2f34ec3.705a014","name":"","statusCode":"","headers":{},"x":770,"y":140,"wires":[]},{"id":"f1323014.0ada3","type":"debug","z":"2f34ec3.705a014","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":180,"wires":[]},{"id":"e99762f.ebd98a","type":"comment","z":"2f34ec3.705a014","name":"create a local web page @ http://localhost:1880/test","info":"","x":550,"y":100,"wires":[]},{"id":"6c942f3c.57ac4","type":"comment","z":"2f34ec3.705a014","name":"Get value of #miv1","info":"","x":450,"y":240,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@nick](https://discourse.nodered.org/u/nick)\
**Post date:** [9 May 2020 11:48 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/4 "2020-05-09T11:48:18Z")

</div>

Steve,

thank you for your replay.  
i tryd to do it that way and i am getting more out of it but still not the value i want.  
what is want to get is the value of 0.350 and for sow far i can see is this the value of tag miv1.

this is the info i get out of is:  
09/05/2020, 10:42:28[node: 293bd546.36eefa](http://127.0.0.1:1880/#)msg : Object  
_object_  
\_msgid: "adde76b7.bb3218"  
topic: ""  
payload: _array[1]_  
0: "0"  
statusCode: 200  
headers: _object_  
server: "SN8200"  
connection: "close"  
transfer-encoding: "chunked"  
content-type: "text/html"  
x-node-red-request-node: "567db754"  
responseUrl: "[http://www.nordpanel.com/2.html](http://www.nordpanel.com/2.html)"

my flow is:

[  
{  
"id": "f708925c.c8e92",  
"type": "http request",  
"z": "1b693388.14c4ec",  
"name": "ampere",  
"method": "GET",  
"ret": "txt",  
"url": "[http://www.nordpanel.com/2.html](http://www.nordpanel.com/2.html)",  
"tls": "",  
"x": 300,  
"y": 480,  
"wires": [  
[  
"2bcb0d18.50a5a2"  
]  
]  
},  
{  
"id": "293bd546.36eefa",  
"type": "debug",  
"z": "1b693388.14c4ec",  
"name": "",  
"active": true,  
"tosidebar": true,  
"console": false,  
"tostatus": false,  
"complete": "true",  
"x": 650,  
"y": 460,  
"wires":  
},  
{  
"id": "c55a5da1.8b647",  
"type": "inject",  
"z": "1b693388.14c4ec",  
"name": "",  
"topic": "",  
"payload": "",  
"payloadType": "date",  
"repeat": "",  
"crontab": "",  
"once": false,  
"onceDelay": "0.5",  
"x": 110,  
"y": 440,  
"wires": [  
[  
"f708925c.c8e92"  
]  
]  
},  
{  
"id": "2bcb0d18.50a5a2",  
"type": "html",  
"z": "1b693388.14c4ec",  
"name": "",  
"property": "payload",  
"outproperty": "payload",  
"tag": "#miv1",  
"ret": "text",  
"as": "single",  
"x": 480,  
"y": 480,  
"wires": [  
[  
"293bd546.36eefa"  
]  
]  
}  
]

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 May 2020 11:59 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/5 "2020-05-09T11:59:08Z")

</div>

Hi.

1. Please edit you flow and put 3 backticks above and below each code section  
```  
Code here  
```

2. I have no access to [http://www.nordpanel.com/2.html](http://www.nordpanel.com/2.html) so I have no idea what is in miv1. Please copy the html and paste it here (between 3 backticks)

---

<div class="post-metadata">

**Author:** ![nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@nick](https://discourse.nodered.org/u/nick)\
**Post date:** [9 May 2020 14:16 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/6 "2020-05-09T14:16:18Z")

</div>

flow:

```auto
[
{
        "id": "f708925c.c8e92",
        "type": "http request",
        "z": "1b693388.14c4ec",
        "name": "ampere",
        "method": "GET",
        "ret": "txt",
        "url": "http://www.nordpanel.com/2.html",
        "tls": "",
        "x": 300,
        "y": 480,
        "wires": [
            [
                "2bcb0d18.50a5a2"
            ]
        ]
    },
    {
        "id": "293bd546.36eefa",
        "type": "debug",
        "z": "1b693388.14c4ec",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "x": 650,
        "y": 460,
        "wires": []
    },
    {
        "id": "c55a5da1.8b647",
        "type": "inject",
        "z": "1b693388.14c4ec",
        "name": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "0.5",
        "x": 110,
        "y": 440,
        "wires": [
            [
                "f708925c.c8e92"
            ]
        ]
    },
    {
        "id": "2bcb0d18.50a5a2",
        "type": "html",
        "z": "1b693388.14c4ec",
        "name": "",
        "property": "payload",
        "outproperty": "payload",
        "tag": "#miv1",
        "ret": "text",
        "as": "single",
        "x": 480,
        "y": 480,
        "wires": [
            [
                "293bd546.36eefa"
            ]
        ]
    }
]

```

html source code :

```auto
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	
	<head>
	<link rel="icon" href="favicon.ico" />

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Cache-control" content="no-cache" />
	<meta name="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="-1" /> 
	<title>-</title>
	<script type="text/javascript" src="javascript/jquery.js"></script>

	<script type="text/javascript" src="javascript/json2.min.js"></script>

	<link rel="stylesheet" type="text/css" href="style_base.css"/>

	<link rel="stylesheet" type="text/css" href="style_img.css"/>

	<style type="text/css">
	/*custom page*/
	
	textarea { /* Stili per il campo di testo e per la textarea */
	background: #1C1C1C; /* Colore di sfondo */
	border: 1px solid #323232; /* Bordo */
	color: #fff; /* Colore del testo */
	height: 30px; /* Altezza */
	line-height: 30px; /* Altezza di riga */
	width: 300px; /* Larghezza */
	padding: 0 10px; /* Padding */
	}
	</style>
	</head>
	
	<body bgcolor="#333333">
	<div id="corpo" >
	<table width="950" height="100%" border="0" align="center" >
	<tr>
	<td align="left" width="10px"><div id="headerL"></div></td>
	<td align="center"><div id="headerC" style="display: table;"></div></td>
	<td align="right" width="10px"><div id="headerR"></div></td>
	</tr>
	<tr>
	<td height="100" colspan="3" align="center" valign="middle">
	<div id="simulazione"></div>
	<div id="stringa" style="display:none"><input type="memo" size="150" maxlength="150"></div>
	<div id="debug_p"></div>
	<div id="debug_c"></div>
	<div id="debug_r"></div>
	<div id="countdown"></div>
	<div id="alert_1"></div>
	<div id="stoppoll"></div>
	<div id="contatore"></div></td>
	</tr>
	</table>
	<table width="950" height="100%" border="0" align="center" >
	<tr>
	<td height="100" colspan="5" align="center" valign="middle" ><div id="panelX">
	<select id="bt" name="bt" class="inputs2" style="font-size:36px" onchange="sendData('bt',4)">
	<option value="0">Pb Lead Acid</option>
	<option value="1">Gel</option>
	<option value="2">AGM</option>
	</select>
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
	<select id="am" name="am" class="inputs2" style="font-size:36px" onchange="sendData('am',4)">
	<option value="00">55</option>
	<option value="01">65</option>
	<option value="02">80</option>
	<option value="03">85</option>
	<option value="04">100</option>
	<option value="05">105</option>
	<option value="06">115</option>
	<option value="07">130</option>
	<option value="08">145</option>
	<option value="09">160</option>
	<option value="10">200</option>
	<option value="11">220</option>
	<option value="12">240</option>
	</select>
	</div></td>
	</tr>
	<tr>
	<td colspan="5" align="center"><div id="avvisi">
	<div class="gr-avvisi">
	<div id="avvisi2" style="text-align:center;font-size:54px"></div>
	</div>
	</div></td>
	</tr>
	<tr>
	<td colspan="5" align="" ><!-- MISURATORI
	style="border:#FFF; border-style:solid;display:table"
	-->
	
	<div id="misuratori">
	<div class="misuratore" id="bat1">
	<div style="float:left;"><i class="fanta fanta-b_amp1"></i></div>
	<div class="vumeter">
	<div class="styled"> 
	<!--<meter id="bt1" min="9" max="15" value="12"></meter>-->
	<div class="progress-bar">
	<div id="mib1" ></div>
	</div>
	</div>
	<div id="scala1"> </div>
	</div>
	<div class="valoreb">Ampere<br />
	<div id="miv1" style="fontsize:50px;">0</div>
	</div>
	</div>
	<div class="misuratore" id="bat1">
	<div style="float:left;"><i class="fanta fanta-b_bt2"></i></div>
	<div class="vumeter">
	<div class="styled">
	<div class="progress-bar">
	<div id="mib2" ></div>
	</div>
	</div>
	<div id="scala2"> </div>
	</div>
	<div class="valoreb">VOLT<br />
	<div id="miv2" >0</div>
	</div>
	</div>
	
	<!-- AMPEROMETRO -->
	
	<div class="misuratore" id="amp1">
	<div style="float:left;"><i class="fanta fanta-b_tm1"></i></div>
	<div class="vumeter">
	<div class="styled">
	<div class="progress-bar">
	<div id="mib3" ></div>
	</div>
	</div>
	<div id="scala3"> </div>
	</div>
	<div class="valoreb">C°
	<div id="miv3" >0</div>
	</div>
	</div>
	
	<!---->
	
	<div class="misuratore" id="ser2">
	<div style="float:left;"><i class="fanta fanta-b_ch1"></i></div>
	<div class="vumeter">
	<div class="styled">
	<div class="progress-bar">
	<div id="mib4" ></div>
	</div>
	</div>
	<div id="scala4"> </div>
	</div>
	<div class="valoreb">%<br />
	<div id="miv4" >0</div>
	</div>
	</div>
	
	<!----> 
	<!-- SERBATOI -->
	
	<div class="misuratore" id="ser1">
	<div style="float:left;"><i class="fanta fanta-b_hl1"></i></div>
	<div class="vumeter">
	<div class="styled">
	<div class="progress-bar">
	<div id="mib5" ></div>
	</div>
	</div>
	<div id="scala5"> </div>
	</div>
	<div class="valoreb">%<br />
	<div id="miv5" >0</div>
	</div>
	</div>
	</div>
	
	<!----></td>
	</tr>
	</table>
	</div>
	
	<!--Container -->
	<div style="visibility:hidden"></div>
	
	<!--END POPUP-->
	<div class='overlay'></div>
	<div class='overlay2'></div>
	<div id="modal1" class="trg-overlay hide standard"> </div>
	<div id="modal2" class="trg-overlay hide standard"> </div>
	<div id="modal3" class="trg-overlay hide standard"> </div>
	</body>
	<script> 
	var pagina='2';
	</script>
	<script defer src="jdeni5.js"></script>

	</html>

```

htlm inspect code:

```auto
<html><head>
<link rel="icon" href="favicon.ico">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-control" content="no-cache">
<meta name="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">  
<title>Nord Panel 2019</title>
<script type="text/javascript" src="javascript/jquery.js"></script>
<script type="text/javascript" src="javascript/json2.min.js"></script>
<link rel="stylesheet" type="text/css" href="style_base.css">
<link rel="stylesheet" type="text/css" href="style_img.css">
<style type="text/css">
/*custom page*/

textarea { /* Stili per il campo di testo e per la textarea */
	background: #1C1C1C; /* Colore di sfondo */
	border: 1px solid #323232; /* Bordo */
	color: #fff; /* Colore del testo */
	height: 30px; /* Altezza */
	line-height: 30px; /* Altezza di riga */
	width: 300px; /* Larghezza */
	padding: 0 10px; /* Padding */
}
</style>
</head>

<body bgcolor="#333333">
<div id="corpo">
  <table width="950" height="100%" border="0" align="center">
    <tbody><tr>
      <td align="left" width="10px"><div id="headerL"><div id="logo"><div class="logo" style="background: url(&quot;logo2.png&quot;); width: 110px; height: 110px;"></div></div></div></td>
      <td align="center"><div id="headerC" style="display: table;"><div id="menu"><div id="menu1"><div id="menu2"><a href="index.html"><i id="home" class="fanta fanta-m_home_0"></i></a><a href="1.html"><i id="boil" class="fanta fanta-m_cald_0"></i></a><a href="5.html"><i id="clim" class="fanta fanta-m_cli_0"></i></a><a href="2.html"><i id="conf" class="fanta fanta-m_bat_1"></i></a><a href="3.html"><i id="pass" class="fanta fanta-m_pass_0"></i></a><a href="4.html"><i id="info" class="fanta fanta-m_info_0"></i></a></div></div></div></div></td>
      <td align="right" width="10px"><div id="headerR"><div id="power"><button type="button" class="fanta fanta-c_on_1" data="modal1" id="cmd_gen"></button> <div class="clear"></div></div></div></td>
    </tr>
    <tr>
      <td height="100" colspan="3" align="center" valign="middle">
      <div id="simulazione"></div>
      <div id="stringa" style="display:none"><input type="memo" size="150" maxlength="150"></div>
        <div id="debug_p"></div>
        <div id="debug_c"></div>
        <div id="debug_r"></div>
        <div id="countdown"></div>
        <div id="alert_1"></div>
        <div id="stoppoll"></div>
        <div id="contatore"></div></td>
    </tr>
  </tbody></table>
  <table width="950" height="100%" border="0" align="center">
    <tbody><tr>
      <td height="100" colspan="5" align="center" valign="middle"><div id="panelX">
          <select id="bt" name="bt" class="inputs2" style="font-size:36px" onchange="sendData('bt',4)">
            <option value="0">Pb Lead Acid</option>
            <option value="1">Gel</option>
            <option value="2">AGM</option>
          </select>
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          <select id="am" name="am" class="inputs2" style="font-size:36px" onchange="sendData('am',4)">
             <option value="00">55</option>
            <option value="01">65</option>
            <option value="02">80</option>
            <option value="03">85</option>
            <option value="04">100</option>
            <option value="05">105</option>
            <option value="06">115</option>
            <option value="07">130</option>
            <option value="08">145</option>
            <option value="09">160</option>
            <option value="10">200</option>
			<option value="11">220</option>
            <option value="12">240</option>
          </select>
        </div></td>
    </tr>
    <tr>
      <td colspan="5" align="center"><div id="avvisi">
          <div class="gr-avvisi">
            <div id="avvisi2" style="text-align:center;font-size:54px"> </div>
          </div>
        </div></td>
    </tr>
    <tr>
      <td colspan="5" align=""><!-- MISURATORI
          style="border:#FFF; border-style:solid;display:table"
          -->
        
        <div id="misuratori">
          <div class="misuratore" id="bat1">
            <div style="float:left;"><i class="fanta fanta-b_amp1"></i></div>
            <div class="vumeter">
              <div class="styled"> 
                <!--<meter id="bt1" min="9" max="15" value="12"></meter>-->
                <div class="progress-bar">
                  <div id="mib1" style="width: 2%; margin-left: 49%; background: yellow;"></div>
                </div>
              </div>
              <div id="scala1"><ul id="scaleap"><li><span>-40</span></li><li><span>-20</span></li><li><span>0</span></li><li><span>20</span></li><li style="margin-right:0px;"><span>40</span></li></ul></div>
            </div>
            <div class="valoreb">Ampere<br>
              <div id="miv1" style="fontsize:50px;"> 0.108</div>
            </div>
          </div>
          <div class="misuratore" id="bat1">
            <div style="float:left;"><i class="fanta fanta-b_bt2"></i></div>
            <div class="vumeter">
              <div class="styled">
                <div class="progress-bar">
                  <div id="mib2" style="width: 83.83%; background: yellow;"></div>
                </div>
              </div>
              <div id="scala2"><ul id="scalebt"><li><span>9</span></li><li><span>10.5</span></li><li><span>12</span></li><li><span>13.5</span></li><li style="margin-right:0px;"><span>15</span></li></ul></div>
            </div>
            <div class="valoreb">VOLT<br>
              <div id="miv2">14.03</div>
            </div>
          </div>
          
          <!-- AMPEROMETRO -->
          
          <div class="misuratore" id="amp1">
            <div style="float:left;"><i class="fanta fanta-b_tm1"></i></div>
            <div class="vumeter">
              <div class="styled">
                <div class="progress-bar">
                  <div id="mib3" style="width: 40%; background: green;"></div>
                </div>
              </div>
              <div id="scala3"><ul id="scaleap"><li><span>-40</span></li><li><span>0</span></li><li><span>40</span></li><li><span>80</span></li><li style="margin-right:0px;"><span>125</span></li></ul></div>
            </div>
            <div class="valoreb">C°
              <div id="miv3"> 24.0</div>
            </div>
          </div>
          
          <!---->
          
          <div class="misuratore" id="ser2">
            <div style="float:left;"><i class="fanta fanta-b_ch1"></i></div>
            <div class="vumeter">
              <div class="styled">
                <div class="progress-bar">
                  <div id="mib4" style="width: 92.5%; background: yellow;"></div>
                </div>
              </div>
              <div id="scala4"> <ul id="scalesr"><li><span>0</span></li><li><span>20</span></li><li><span>40</span></li><li><span>60</span></li><li><span>80</span></li><li style="margin-right:0px;"><span>100</span></li></ul></div>
            </div>
            <div class="valoreb">%<br>
              <div id="miv4"> 92.5</div>
            </div>
          </div>
          
          <!----> 
          <!-- SERBATOI -->
          
          <div class="misuratore" id="ser1">
            <div style="float:left;"><i class="fanta fanta-b_hl1"></i></div>
            <div class="vumeter">
              <div class="styled">
                <div class="progress-bar">
                  <div id="mib5" style="width: 88%; background: yellow;"></div>
                </div>
              </div>
              <div id="scala5"> <ul id="scalesr"><li><span>0</span></li><li><span>20</span></li><li><span>40</span></li><li><span>60</span></li><li><span>80</span></li><li style="margin-right:0px;"><span>100</span></li></ul></div>
            </div>
            <div class="valoreb">%<br>
              <div id="miv5"> 88.0</div>
            </div>
          </div>
        </div>
        
        <!----></td>
    </tr>
  </tbody></table>
</div>

<!--Container -->
<div style="visibility:hidden"></div>

<!--END POPUP-->
<div class="overlay"></div>
<div class="overlay2" style="display: block; top: 0px; opacity: 0.7;"></div>
<div id="modal1" class="trg-overlay hide standard"><!-- Modal header--><a class="close-overlay" style="color:#000;font-size:60px">×</a><br><br><br><br><br><br><h2><input style="float:left;font-size:60px" class="close" name="" type="button" value="OFF" onclick="sendData('cmd_ge0',2);"></h2><input class="close" name="" type="button" value="Stand By" style="float:right;font-size:60px" onclick="sendData('cmd_ge2',2);"></div>
<div id="modal2" class="trg-overlay hide standard"><!-- Modal header--> <a class="close-overlay" style="color:#000;font-size:60px">×</a><br><br><br><br><br><br><input style="float:left;font-size:60px" class="close" name="" type="button" value="OFF" onclick="sendData('cmd_ge0',2);"><input class="close" name="" type="button" value="ON" style="float:right;font-size:60px" onclick="sendData('cmd_ge1',2);"></div>
<div id="modal3" class="trg-overlay hide standard"> </div>

<script> 
var pagina='2';
</script>
<script defer="" src="jdeni5.js"></script>
</body></html>

```

screenshot of webpage:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/4/f4d5969b99c49e46d6008a749b1f3613be413a11.png)

sow i want to get the value of the ampere, and i think it is tag miv1.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 May 2020 15:38 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/7 "2020-05-09T15:38:51Z")

</div>

> [@nick](#):
>
> html source code

^ look at the div `#miv1` in "html source code" it has `0` in it.

I suspect the value is updated by a script **after** the page is loaded (in a browser) and that's why you get `0` at first.

You might have to go further back. Where does this web page get that data? Can you connect to the data source?

Maybe if you watch the "Network" tab in chrome devtools (F12) while the page loads you might see where the data comes from.

Other than that, I can't think of a way to extract a dynamic scripted value.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [10 May 2020 11:38 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/8 "2020-05-10T11:38:32Z")

</div>

> [@Steve-Mcl](#):
>
> I can't think of a way to extract a dynamic scripted value.

Generically, to do that, you need a node that runs a full headless browser. [https://flows.nodered.org/node/node-red-contrib-nbrowser](https://flows.nodered.org/node/node-red-contrib-nbrowser) is a node that will do this.

However, I agree that working out how to get the source data would be better if it is possible.

This is likely the code that loads the data: `<script defer src="jdeni5.js"></script>` - are you able to share that js code?

---

<div class="post-metadata">

**Author:** ![nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@nick](https://discourse.nodered.org/u/nick)\
**Post date:** [11 May 2020 16:43 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/9 "2020-05-11T16:43:32Z")

</div>

i tried to do get the value but no suc6.

jdeni5.js is to long to put here so you will find it in the attachement  
but if you look for the miv1 tag you will get this code:

```auto
var status = json.A;
        var arr_st = status.split("");                  
        accensione(cmd_gen, arr_st[0]);
        //trasformo le stringhe di configurazione A e Y in array
        //var arr_st = status.split("");
        if (alarms==""){$("#avvisi").hide();}else{$("#avvisi").show();}
        avvisi2.innerHTML=alarms;
        $( '#bt').val(cb2);
        $( '#am').val(cb1);
        miv1.innerHTML=mi1;                                                     
        miv2.innerHTML=mi2;                                                                                             
        miv3.innerHTML=mi3;                                             
        miv4.innerHTML=mi4;
        miv5.innerHTML=mi5;
        metro2(mib1,mi1,-40,80);
        scalam(2,1);
        metro(mib2,mi2,9,6);
        scalam(1,2);
        metro3(mib3,mi3,-40,160);
        scalam(3,3);
        metro(mib4,mi4,0,100);
        scalam(0,4);
        metro(mib5,mi5,0,100);
        scalam(0,5);

```

[Untitled 1 txt.txt](https://discourse.nodered.org/uploads/short-url/5uSR4rnNqhCsJFc8DY1rt7Owhw4.txt) (65.7 KB)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [11 May 2020 19:46 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/10 "2020-05-11T19:46:55Z")

</div>

There are 9 ajax calls, this is the first:

```auto
/*------------------------------
        CHIAMATE
--------------------------------*/
/*------------Read--------------*/      
function leggiData(){
        var params;
        params = { "p": 1, "l": 250, "t": 1, "e":"656F72"};                             
        debug_c(JSON.stringify(params));
        $.ajax({
                type: "POST",
                url: "/sws/uart/rd",
                data: {Params: JSON.stringify(params)},
                dataType: "jsonp"
        }).done()                       
        .error()
        .always();      
}

```

You will need a tool that lets you do POST calls. ~~There are browser addons.~~ Actually that is deprecated, try [https://www.postman.com/](https://www.postman.com/) instead.

Best to open the normal page first in one tab and then use the browser addon to POST to the appropriate endpoint. You can get the paramters used by opening your browser dev tools then refreshing the normal page and going to the network tab of the dev tools. You will need to search through for where it does the posts, you should be able to see all of the data that is sent and received.

Try reproducing that in postman. If it fails, it will likely be due to security headers or cookies that you will need to fiddle with.

---

<div class="post-metadata">

**Author:** ![nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@nick](https://discourse.nodered.org/u/nick)\
**Post date:** [13 May 2020 07:58 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/11 "2020-05-13T07:58:42Z")

</div>

sow you don't think it is possible to get the value directly to node red?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [13 May 2020 08:00 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/12 "2020-05-13T08:00:45Z")

</div>

If a web page can do it, it is very likely node-red can do it.

It partly depends on how that page gets data, if there is any security involved etc.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 May 2020 11:03 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/13 "2020-05-13T11:03:51Z")

</div>

Not impossible, just really difficult since the data is added to the page dynamically _after_ the page load. That is why, if you use an http\_request node, you will not see the data. The data is added to the page after loading by some JavaScript processing that does extra calls to get the data (the AJAX bits).

As stated, you could use a headless browser node which would pretend to be a real browser and so execute the JavaScript, then the data would be available. Or you could work out how to get the data yourself.

Both of those are possible with Node-RED. Neither is especially easy but certainly doable.

---

<div class="post-metadata">

**Author:** ![nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@nick](https://discourse.nodered.org/u/nick)\
**Post date:** [13 May 2020 15:44 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/14 "2020-05-13T15:44:21Z")

</div>

sow i try'd to start the java script befor getting the value with a headless browser node.  
but still no result.  
can you maby check if i am doing something wrong in my flow?

```auto
[
    {
        "id": "d2afdd66.3fe0e",
        "type": "http request",
        "z": "cbc40383.12497",
        "name": "connect to browser",
        "method": "GET",
        "ret": "txt",
        "url": "http://nordpanel.com/2.html",
        "tls": "",
        "x": 470,
        "y": 100,
        "wires": [
            [
                "54277d17.c1ff04"
            ]
        ]
    },
    {
        "id": "1baac6b9.ff3589",
        "type": "debug",
        "z": "cbc40383.12497",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "true",
        "x": 810,
        "y": 100,
        "wires": []
    },
    {
        "id": "b5fddecb.69f2b",
        "type": "inject",
        "z": "cbc40383.12497",
        "name": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "0.5",
        "x": 190,
        "y": 120,
        "wires": [
            [
                "e373b977.922268"
            ]
        ]
    },
    {
        "id": "54277d17.c1ff04",
        "type": "html",
        "z": "cbc40383.12497",
        "name": "",
        "property": "payload",
        "outproperty": "payload",
        "tag": ".miv1",
        "ret": "html",
        "as": "single",
        "x": 670,
        "y": 120,
        "wires": [
            [
                "1baac6b9.ff3589"
            ]
        ]
    },
    {
        "id": "e373b977.922268",
        "type": "nbrowser",
        "z": "cbc40383.12497",
        "name": "",
        "methods": [
            {
                "name": "gotoURL",
                "func": "goto",
                "params": [
                    {
                        "type": "str",
                        "value": "http://nordpanel.com/2.html",
                        "typeDefault": "str"
                    }
                ]
            },
            {
                "name": "injectJavaScript",
                "func": "injectJavaScript",
                "params": [
                    {
                        "type": "str",
                        "value": "jdeni5.js",
                        "typeDefault": "str"
                    }
                ]
            }
        ],
        "prop": "instance",
        "propout": "payload",
        "object": "msg",
        "objectout": "msg",
        "close": false,

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 July 2020 15:44 UTC](https://discourse.nodered.org/t/get-value-from-local-webpage/26324/15 "2020-07-12T15:44:22Z")

</div>

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