Well the htmo code is something like this:
<a href="javascript:my_win('.......'">
<img src="...." border=0>
<font color="red">title
</a>
</font>
and I want to identify the color only for those a's which href contains th word:
javascript:my_win
This is my query:
$xpath->query('//a[contains(@href,"javascript:my_win")]/font');
but I get nothing.
If my query changes to this, I normally get all the hrefs, so there is no chance of mispelling.
$elements = $xpath->query('//a');
If my query changes to this Every colot is being printed out.
$elements = $xpath->query('//a/font');
Whole code is here:
$elements = $xpath->query('//a[contains(@href,"javascript:my_win")]/font');
foreach ( $elements as $element ) {
$str1=$element->getAttribute('color');
}