标签:索引 put 逻辑 sele 属性 https select span sel
| 定位方式 | xpath | CSS | |
| 常规属性 | id | //*[@id=‘kw‘] | #kw |
| class | //input[@class=‘s_ipt‘] | .s_ipt | |
| name | //input[@name=‘wd‘] | [name=‘wd‘] | |
| 其他属性 | 其他属性 | //input[@autocomplete=‘off‘] | [autocomplete=‘off‘] |
| 多个属性组合(逻辑运算) | //input[@type=‘text‘and @name=‘wd‘] | [type=‘text‘][name=‘wd‘] | |
| 文本属性 | //*[text()=‘文本内容‘] | ||
| 层级关系 | 相对路径 | //form[@id=‘form]/span/input | form#form>span>input |
| 索引 | //select[@id=‘nr‘]/option[3] | select#nr>option:nth-child(3) | |
| select#nr>option:eq(2) | |||
| select#nr>option:first | |||
| select#nr>option:last | |||
| 通过儿子找父亲 | 两个点代表父级 | //*[@id=‘‘]/../.. | |
| 模糊匹配 | 模糊匹配text | //*[contains(text(),‘糯米‘)] | |
| 模糊匹配某个属性 | //*[contains(@class,‘s_ip‘)] | ||
| 模糊匹配以xx开头 | //*[starts-with(@id,‘xx‘)] |
转自:https://www.cnblogs.com/anthinia/p/10735877.html
标签:索引 put 逻辑 sele 属性 https select span sel
原文地址:https://www.cnblogs.com/XiaoF0725/p/12104103.html