首页 > 其他 > 详细

xpath选择兄弟节点、返回上一级和选择多个属性

时间:2019-08-23 14:00:05      阅读:299      评论:0      收藏:0      [点我收藏+]


本文链接:https://blog.csdn.net/ZincZhang/article/details/80248297
选择兄弟节点
选择前N位的div标签
preceding-sibling::div[N]
选择后N位的div标签
following-sibling::div[N]
选择上一级
../
结合使用
//td[text()=‘xxx‘]/../followingsibling::tr//tbody//td[contains(@class, p15)]/table/tbody

排除一个属性的节点
//tbody/tr[not(@class)]
//tbody/tr[not(@class or @id)]

选择一个有某个属性的元素
//div[@name]

xpath选择兄弟节点、返回上一级和选择多个属性

原文:https://www.cnblogs.com/weiwei-python/p/11399200.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!