开发者

Include link anchor text in xpath text extraction?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜