您的位置:首页 > Web前端 > CSS

Selenium学习笔记21_CSS Selector

2017-10-23 15:21 316 查看
翻译自: 英文原文链接

The following table summarizes the Selector syntax:

模式含义描述CSS Level
*any elementuniversal selector2
Ean element of type EType selector1
E[foo]an E element with a “foo” attributeAttribute selector2
E[foo=”bar”]an E element whose “foo” attribute value is equal to “bar”Attribute selector2
E[foo~=”bar”an E element whose “foo” attribute value is a list of whitespace-separated values, one of which is equal to “bar”Attribute selector2
E[foo^=”bar”]an E element whose “foo” attribute starts with “bar”Attribute selector2
E[foo$=”bar”]an E element whose “foo” attribute ends with “bar”Attribute selector3
E[foo*=”bar”]an E element whose “foo” attribute value contains the substring “bar”Attribute selector3
E[foo=”en”]匹配所有att属性具有多个连字号分隔(hyphen-separated)的值、其中一个值以“val”开头的E元素,主要用于lang属性,比如“en”、“en-us”、“en-gb”等等Attribute selector
E:rootan E element, root of the documentStructural pseudo-classes3
E:nth-child(n)an E element, the n-th child of its parentStructural pseudo-classes3
E:nth-last-child(n)an E element, the n-th child of its parent, counting from the last oneStructural pseudo-classes3
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  selenium