没有合适的资源?快使用搜索试试~ 我知道了~
备查,搞爬虫开发者必备
资源推荐
资源详情
资源评论
Selector syntax
A selector is a chain of simple selectors, separated by combinators. Selectors are
(including against elements, attributes, and attribute values).case insensitive
The universal selector (*) is implicit when no element selector is supplied (i.e. *.
and is equivalent).header .header
Pattern Matches Example
* any element *
tag elements with the given tag name div
*|E
elements of type E in any namespace
(including non-namespaced)
*|name finds <fb:
and name> <name>
elements
ns|E elements of type E in the namespace
ns
fb|name finds <fb:
elementsname>
#id elements with attribute ID of "id" div#wrap, #logo
.class elements with a class name of "class" div.left, .result
[attr]
elements with an attribute named "attr"
(with any value)
a[href], [title]
[^attrPrefix]
elements with an attribute name starting
with "attrPrefix". Use to find elements
with HTML5 datasets
[^data-], div
[^data-]
[attr=val]
elements with an attribute named "attr",
and value equal to "val"
img[width=500], a
[rel=nofollow]
[attr="val"]
elements with an attribute named "attr",
and value equal to "val"
span[hello="
Cleveland"]
[goodbye="Columbus"]
, a[rel="nofollow"]
[attr^=valPrefix]
elements with an attribute named "attr",
and value starting with "valPrefix"
a[href^=http:]
[attr$=valSuffix]
elements with an attribute named "attr",
and value ending with "valSuffix"
img[src$=.png]
[attr*=valContaining]
elements with an attribute named "attr",
and value containing "valContaining"
a[href*=/search/]
[attr~= ]
regex
elements with an attribute named "attr",
and value matching the regular expression
img[src~=(?i)\.
(png|jpe?g)]
The above may be combined in any order div.header[title]
Combinators
资源评论
北极象
- 粉丝: 1w+
- 资源: 345
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功