Good evening, I have been trying for three days to retrieve data from an HTML page using the HTML node.
Unfortunately, I am only able to partially extract the data. I would like to understand what I am doing wrong.
This is the html code of the page.
<body class="stileSito">
<!-- logo aquatronica -->
<p align="center"><img border="0" src="./Aquatronica System Controller - Ethernet Controller - v. 1.1 - Real Time Monitor_files/logo.gif" width="350" height="64"></p>
<!-- titolo della pagina -->
<p class="titoloPaginaRTM">Real Time Monitor</p>
<center><p class="styleStatusErrComm" id="_ERR_BUS"></p></center>
<center><p align="center" id="_PULSANTE_LOGOUT"></p></center>
<hr>
<!-- tabella principale -->
<table border="0" width="100%">
<tbody>
<tr>
<!-- sottotabella per unita' di potenza -->
<td width="70%" valign="top">
<b>Power Units</b><br>
<table border="1" width="100%" bordercolor="#000000" cellspacing="0" cellpadding="2" bordercolorlight="#000000" bordercolordark="#000000">
<tbody id="_LISTA_PU">
<tr>
<td width="20%" class="intestazionePowerUnit" height="40" xml:space="preserve"> </td>
<td width="10%" class="intestazionePowerUnit">A</td>
<td width="10%" class="intestazionePowerUnit">B</td>
<td width="10%" class="intestazionePowerUnit">C</td>
<td width="10%" class="intestazionePowerUnit">D</td>
<td width="10%" class="intestazionePowerUnit">E</td>
<td width="10%" class="intestazionePowerUnit">F</td>
<td width="10%" class="intestazionePowerUnit">G</td>
<td width="10%" class="intestazionePowerUnit">H</td>
</tr>
<tr><td class="intestazionePowerUnit">Unit� di Potenza</td><td class="cellePlug" align="center" style="border: 6px ridge silver; border-spacing: 1px;"><map title="Plug: CO2 - Status: OFF" indexpu="0" indexplug="0" style="width: 100%; height: 100%;"><img src="./Aquatronica System Controller - Ethernet Controller - v. 1.1 - Real Time Monitor_files/bianco.gif" border="1px" style="border-style: dotted;"></map></td><td class="cellePlug" align="center" style="border: 6px ridge blue; border-spacing: 1px;"><map title="Plug: MODULO ETH - Status: ON - Timer program" indexpu="0" indexplug="1" style="width: 100%; height: 100%;"><img src="./Aquatronica System Controller - Ethernet Controller - v. 1.1 - Real Time Monitor_files/orologio.gif"></map></td><td class="cellePlug" align="center" style="border: 6px ridge silver; border-spacing: 1px;"><map title="Plug: C - Status: OFF" indexpu="0" indexplug="2" style="width: 100%; height: 100%;"><img src="./Aquatronica System Controller - Ethernet Controller - v. 1.1 - Real Time Monitor_files/bianco.gif" border="1px" style="border-style: dotted;"></map></td><td class="cellePlug" align="center" style="border: 6px ridge blue; border-spacing: 1px;"><map title="Plug: WIFI TO ETH - Status: ON - Timer program" indexpu="0" indexplug="3" style="width: 100%; height: 100%;"><img src="./Aquatronica System Controller - Ethernet Controller - v. 1.1 - Real Time Monitor_files/orologio.gif"></map></td><td class="cellePlug" align="center" style="border: 6px ridge silver; border-spacing: 1px;"><map title="Plug: NEON - Status: OFF" indexpu="0" indexplug="4" style="width: 100%; height: 100%;"><img src="./Aquatronica System Controller - Ethernet Controller - v. 1.1 - Real Time Monitor_files/bianco.gif" border="1px" style="border-style: dotted;"></map></td><td class="cellePlug" align="center" style="border: 6px ridge blue; border-spacing: 1px;"><map title="Plug: RISCALDATORE - Status: ON - Temperature sensor program" indexpu="0" indexplug="5" style="width: 100%; height: 100%;"><img src="./Aquatronica System Controller - Ethernet Controller - v. 1.1 - Real Time Monitor_files/temperatura.gif"></map></td><td class="cellePlug" align="center" style="border: 6px ridge blue; border-spacing: 1px;"><map title="Plug: FILTRO - Status: ON - Timer program" indexpu="0" indexplug="6" style="width: 100%; height: 100%;"><img src="./Aquatronica System Controller - Ethernet Controller - v. 1.1 - Real Time Monitor_files/orologio.gif"></map></td><td class="cellePlug" align="center" style="border: 6px ridge silver; border-spacing: 1px;"><map title="Plug: AERATORE - Status: OFF" indexpu="0" indexplug="7" style="width: 100%; height: 100%;"><img src="./Aquatronica System Controller - Ethernet Controller - v. 1.1 - Real Time Monitor_files/bianco.gif" border="1px" style="border-style: dotted;"></map></td></tr></tbody>
</table>
<div id="_LEGENDA" class="legenda"></div>
</td>
<!-- sottotabella per elenco sensori -->
<td width="30%" valign="top">
<b>Sensors</b>
<table border="0" width="100%" cellpadding="2" class="listaSensori">
<!-- lista dei sensori -->
<tbody id="_LISTA_SENSORI"><tr>
<td class="nomeSensore" style="width: 50%;">Temperatura</td>
<td class="valoreSensore" style="width: 50%; background-color: red;"> !!! 19.9�C !!! </td></tr>
<tr><td class="nomeSensore" style="width: 50%;">pH</td>
<td class="valoreSensore" style="width: 50%; background-color: aqua;">6.56</td></tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<hr>
<input type="button" class="stylePulsanteComando" name="b" value="Start Real Time Monitor" onclick="startRTMonitor()">
<input type="button" class="stylePulsanteComando" name="b" value="Stop Real Time Monitor" onclick="stopRTMonitor()">
<input type="button" class="stylePulsanteComando" name="disImg" id="_YES_NO_IMG" value="No icons">
<p id="_STATUS_BAR"><div class="styleStatusBar"><span>Real Time Monitor OFF</span></div></p>
<p>
</p><center>
<p class="piePaginaRT">�Copyright 2006 Aquatronica�</p>
<p class="piePaginaRT"><a href="http://www.aquatronica.it/"><b>www.aquatronica.it</b></a></p>
<p class="piePaginaRT"><a href="mailto:info@aquatronica.com"><b>info@aquatronica.com</b></a></p>
</center>
<p></p>
<p id="_PROGRESS_BAR"> <div class="styleStatusWait"></div></p>
<div id="_NO_CONNECTION_BAR" style="position:absolute;top:1;left:1"> <div class="styleStatusErrComm"></div></div>
<div id="_EXIT" style="font-size:10;font-weight:bold;position:absolute;top:1;right:10"><a id="_BACK_HOME" href="http://192.168.1.45/index.htm" title="Aquarium Home Page"><< Home Page</a></div>
<!-- <input type="button" name="bb" value="copy" onclick="var n = document.getElementById('_ORIGINE').cloneNode(true);document.getElementById('_DESTINAZIONE').appendChild(n);"/> -->
<div id="_NASCOSTO" style="display:none">
I,m trying to read this 2 values:
<tbody id="_LISTA_SENSORI">
<tr>
<td class="nomeSensore" style="width: 50%;">Temperatura</td>
<td class="valoreSensore" style="width: 50%; background-color: red;"> !!! 19.9�C !!! </td>
</tr>
<tr>
<td class="nomeSensore" style="width: 50%;">pH</td>
<td class="valoreSensore" style="width: 50%; background-color: aqua;">6.56</td>
</tr>
In my html node i have put this on the selector field:
body>table>tbody>tr>td>table.listaSensori>tbody#_LISTA_SENSORI>tr:nth-child(1)>td.nomeSensore
B
ut it returns me an empty object.
What's wrong??
Thank you all, Marco.