1

I have some div with text and links.

<div id="mydiv">
some text <a href="#">super link</a> la la la
</div>

I need to get output with xPath:

some text la la la

Is it possible?

kjhughes
  • 106,133
  • 27
  • 181
  • 240
  • 1
    Possible duplicate of [Xpath - get only node content without other elements](https://stackoverflow.com/questions/4455684/xpath-get-only-node-content-without-other-elements) – Heretic Monkey Aug 30 '19 at 12:53

1 Answers1

2

Yes, you want that string value of the div:

string(//div[@id="mydiv"])

will return

some text la la la

as requested.

kjhughes
  • 106,133
  • 27
  • 181
  • 240