开发者

Include link anchor text in xpath text extraction?

开发者 https://www.devze.com 2023-03-23 21:42 出处:网络
I have a series of <p> tags, an example: <p>normal text<a href=\"#\">link ancho开发者_如何学Cr text</a>more normal text</p>

I have a series of <p> tags, an example:

<p>normal text<a href="#">link ancho开发者_如何学Cr text</a>more normal text</p>

the XPath //p/text() doesn't include "link anchor text", how can I include it?


//p/text() asks for all text nodes that are direct children of p elements. You could ask for //p//text(), but I'm guessing you are actually looking for string(//p).

0

精彩评论

暂无评论...
验证码 换一张
取 消