- 路径查询
//: 查找所有子孙节点,不考虑层级关系
/: 找直接子节点 - 谓词查询
//div[@id]
// div[@id=“maincontent”] - 属性查询
@class
- 模糊查询
//div[contains(@id,“he”)]
// div[starts-with(@id,“he”)] - 内容查询
//div/h1/text()
- 逻辑运算
//div[@id=“head” and @class=“s_down”]
//title | //price
xpath基本语法
最新推荐文章于 2024-07-24 23:49:50 发布