Umair Mubeen
Umair Mubeen

Reputation: 843

how to get only label text not span text in selenium python?

Here is the html

<label>Hello <span class="">Span text here</span></label>

Any Help would be appreciated & thanks in Advance

Upvotes: 1

Views: 280

Answers (1)

0buz
0buz

Reputation: 3503

This xpath matches only text from parent tag:

//label/text()

Upvotes: 1

Related Questions