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!
精彩评论