Reputation:
It is possible to do this:
in the document I have several tables:
...
table id="odds_ou_159.5"
table id="odds_ou_160.5"
table id="odds_ou_161.5"
...
Tables contain several classes:
...
tr class = odd>
tr class = odd>
...
class odd
contain:
td class = bookmaker ...
td> 161.5 </td>
td class = kx
td class = kx
td class = bonus
....
class kx
contain:
span class=" odds-wrap " eu="1.90"> 1.90
Now I need to get content of class odd or just text from <td> 161.5 </td>
, but my condition has to be eu="1.90"
Is it possible to get content of Ancestors (in my case class odd
) depending on attribute values of Descendants (in my case eu=1.90
)
Upvotes: 2
Views: 77
Reputation: 52665
Try this XPath
and let me know in case of any issues:
//td[span[@eu="1.90"]]/preceding-sibling::td
Upvotes: 2