开发者

Xpath: how to select a descendant regardless any ancestor?

Is this valid ?

//p//div/a

Expected to match a regardless any element between p and div, like in:

//p/span/div/a

//p/strong/span/i/div/开发者_JAVA技巧a


Why not simply use: //p//div/a. This will match p appearing anywhere and div/a appearing at any level (i.e., descendent) under p.

I see you have edited your question to match my answer, so now the answer is yes!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜