EGE
EGE

Reputation: 69

How to find the xpath of a <td> that has no <label> tag inside of it

I have the following snippet of HTML,

<tr valign="top">
    <td><label>Name</label></td>
    <td>FirstName LastName</td>
</tr>

I can find the xpath of the tr using //tr[@valign='top'] and the xpath of both td's using //tr[@valign='top']/td. I want to craft a xpath that only works for td's that don't have a tag inside of them. Is this possible?

Upvotes: 1

Views: 108

Answers (1)

EGE
EGE

Reputation: 69

I seem to have done solved this using //tr[@valign='top']/td[text()].

Upvotes: 1

Related Questions