i want to exclude the IMG Values in this table:
<table class="info">
<tbody>
<tr><th class="round-top" colspan="2">Status</th></tr>
<tr class="even">
<td class="key">Schaltprogramm aktiv</td>
<td class="value"><img height="15" src="./pics/ste-symbol_an-97b765.png"></td>
</tr>
</tbody>
</table>
I want to exclude the values in this table:
<table class="info">
<tbody>
<tr><th class="round-top" colspan="2">Warmwasser</th></tr>
<tr class="even">
<td class="key">WW-Isttemp.</td>
<td class="value">49,0 °C</td>
</tr>
<tr class="odd">
<td class="key round-leftbottom">WW-Solltemp.</td>
<td class="value round-rightbottom">46,5 °C</td>
</tr>
</tbody></table>
Here are my poorly test:
$nodelist = $xpath->query( "//tr/td[substring(@class,1,5)='value']" );
$imgs = $xpath->query("//table[@class='info']/tr/td/img");
What must i do to exclude the IMG Values in the variable “nodelist”?
Any idea?
I think (but am not certain) that you want
$nodelistto contain all thetdelements whoseclassattribute begins with the stringvaluebut not if they contain animgelement.If that’s a correct interpretation of your question, change
to
I’m not clear what it is you want to do about the temperature values in your second sample table; you might want to edit the question to make clearer whether you want to retrieve them or not.