Issue
So I have something like this
<img src="/icons/folder.gif" alt="[DIR]"> <a href="convobot-main/">convobot-main/</a>
and I want to select the a href only when the img tag has the attribute alt = "[Dir]". How can I achieve this?
Solution
This XPath,
//img[@alt='[DIR]']/following-sibling::a[1]/@href
will select href attributes of all first a siblings of all img elements with an alt attribute value of '[DIR]'.
Answered By - kjhughes
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.