开发者

Xpath: how to select a descendant regardless any ancestor?

开发者 https://www.devze.com 2023-02-01 17:04 出处:网络
Is this valid ? //p//div/a Expected to match a regardless any element between p and div, like in: //p/span/div/a

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

精彩评论

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