4

I want to select the next sibling of a td tag in a tr element.

The tr element is this:

<tr>
  <td>Created On:</td>
  <td>06/28/2018 06:32      </td>
</tr>

My XPATH code looks like this: //text()[contains(.,'Created On:')].

How do I select the next td?

Username
  • 3,463
  • 11
  • 68
  • 111

1 Answers1

7

Try it like this:

//tr/td[text()="Created On:"]/following-sibling::td

Demo

wp78de
  • 18,207
  • 7
  • 43
  • 71