Issue
Is there a way to find an element next to another element as shown in the example below? I'm trying to retrieve the word "Daily" by locating the words "Frequency of Update" first. I think an XPath would be the only way but I'm not sure how to get to it since its not a child element.
image: (http://i.imgur.com/UWI3nLy.png)
Solution
Try this xpath:
//*[contains(text(),'Frequency of Update')]/ancestor::td/following-sibling::td
This will first locate the element having innerHTML/text 'Frequency of Update' in the DOM, then locate 'td' element from all its ancestors, and then locate the 'td' element that is its sibling element, which has the 'Daily' text
Answered By - Subh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.