0

enter image description hereI 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:enter image description here

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.

Vinyasjain77
  • 31
  • 1
  • 7

2 Answers2

1

Tr with the below Xpath:

//strong[text()='Scheduled']/../following-sibling::div//li

hope this works ;)

Sooraj
  • 565
  • 3
  • 8
0

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 :

//strong[text()='Scheduled']//following::div[1]//ul[@class='list-group']/div[@draggable='true']/li[@class='list-group-item']//p
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352