[Selenium] The most commonly used CSSSelector
CSSSelector |
Example |
Description |
element.element |
div.dropdown |
Select all <div> elements whose class=“dropdown” |
element#element |
div#new-input |
Select all <div> elements whose id =“new-input” |
element element |
div p |
Select all <p> elements who are under <div> element |
element>element |
div>p |
Select all <p> elements whose father is <div> element |
[attribute] |
div[rowid] |
Select all <div> elements who has attribute rowid |
[attribute=value] |
input[value='OK'] |
Select all <input> elements whose attribute value is ‘OK’ |
[attribute*=value] |
a[src*=‘abc’] |
Select all <a> elements whose attribute src contains ‘abc’ |
:nth-child(n) |
p:nth-child(2) |
Select all <p> elements who is the second child of its father |
eg 1: div.rtq-grid-row[rowid] div.rtq-grid-cell:nth-child(5) a
eg 2: div#fileUpDiv input[value='OK']
最新文章
- 分布式锁1 Java常用技术方案
- js动态的把左边列表添加到右边,可上下移动。
- shell 中scp密码输入 --expect
- 【Go语言】I/O专题
- UPC 2170 D Equal Is Not Really Equal (欧拉路径)
- 浅谈SQL语句优化经验
- 13个mysql数据库的实用SQL小技巧
- shiro基础学习(二)&mdash;shiro认证
- Java IO 学习总结 学习手册总结
- x64_dbg破解64位WinSnap4.5.6图文视频教程
- java读取mysql表的注释及字段注释
- 阿里字体css代码引入方法
- springboot07-security
- .11-浅析webpack源码之Storage模块
- Python才排第8名!2018增速最快TOP 10编程语言盘点
- translclude
- Android 自定义倒计时控件CountdownTextView
- 七大排序的个人总结(二) 归并排序(Merge
- FlexMonkey实战
- 20155314 2016-2017-2《Java程序设计》课程总结