Reputation: 31
I need to a find an element on my webpage that has same tags as every other element and hence I need to find the xpath based on the title of the sub-section[parent].
Below is the html code of the webpage:
Basically I want to find an element inside the li
tag based on the Scheduled
text on the above image. The id
attribute on the li
tag is dynamic and hence we need to traverse it based on the Scheduled
text in the webpage. Please let me know how it can be done.
Upvotes: 0
Views: 53
Reputation: 193338
To locate the first <p>
element with text as Santoshi Jewargi - 5959 Broadway, The Bronx, NY - Weeding with respect the the element with text as Scheduled you can use the following xpath:
//strong[text()='Scheduled']//following::div[1]//ul[@class='list-group']/div[@draggable='true']/li[@class='list-group-item']//p
Upvotes: 0
Reputation: 585
Tr with the below Xpath:
//strong[text()='Scheduled']/../following-sibling::div//li
hope this works ;)
Upvotes: 1