How To Get A Sub Parent Web Element Component Between Many Div In Selenium Xpath?
I want to get the sub parent element given the text of a post in this case given the text 'post2' that is the second div in the code there are many posts
Solution 1:
a solution that exists is using the "ancestor" keyword:
//div[@id='content']//span[contains(text(), 'post2')]/ancestor::div[@class='post']
Post a Comment for "How To Get A Sub Parent Web Element Component Between Many Div In Selenium Xpath?"