1

Here is the html

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

Any Help would be appreciated & thanks in Advance

Umair Mubeen
  • 823
  • 4
  • 22
  • See if this helps https://stackoverflow.com/questions/28237694/xpath-get-parent-node-from-child-node. –  Jun 22 '20 at 12:18
  • 1
    @AkshatRaj i find out the solution to get the label text only not span thanks for the response – Umair Mubeen Jun 22 '20 at 12:22

1 Answers1

1

This xpath matches only text from parent tag:

//label/text()
0buz
  • 3,443
  • 2
  • 8
  • 29