Ran.L
Ran.L

Reputation: 11

Xpath How to get text with html tag

<div class="content pb10">
        some text<img src="URL"/>
</div>

Like this. I want to use XPath to get text with img tag

some text<img src="URL"/>

Upvotes: 1

Views: 931

Answers (1)

kjhughes
kjhughes

Reputation: 111501

This XPath,

/div[@class='content pb10']/node()

will select all children nodes of that div, including text nodes and elements, as requested.

Upvotes: 1

Related Questions