R
R
rinnn2018-07-04 03:28:55
C++ / C#
rinnn, 2018-07-04 03:28:55

How to find td by text and get next ones?

There is the following XPath: "/html/body/div[2]/table/tbody/tr/td[contains(text(), 1234)]".
How to get the next td after the first found by unique text?
For clarity (I understand that this is wrong), I tried to do this:
/html/body/div[2]/table/tbody/tr/td[contains(text(), 1234)]/td[2]
Please tell me .
Here is the line we find, how to get "strawberry"? The value is not unique, there are many rows in the table, it is generated dynamically.

<tr>
  <td class="rborder" align="center">1234</td>
  <td class="rborder" align="center">            
      Клубника</td>
  </tr>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Fov, 2018-07-04
@rinnn

The following is fine for
XML stuff like this:

<tr>
  <td class="rborder" align="center">1234</td>
  <td class="rborder" align="center">            
      Клубника
  </td>
</tr>

XPath:
result:
String='Клубника'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question