更新 document.md
This commit is contained in:
parent
8d9fc302cb
commit
b6164135f9
55
document.md
55
document.md
@ -61,3 +61,58 @@
|
||||
| headers | Map<String,String> | headers |
|
||||
| statusCode | int | HTTP状态码 |
|
||||
|
||||
#### 内置方法
|
||||
- selector
|
||||
- selectors
|
||||
- xpath
|
||||
- xpaths
|
||||
- regx
|
||||
- regxs
|
||||
- jsonpath
|
||||
|
||||
#### selector/selectors
|
||||
| 参数一 | 参数二 | 参数三 | 参数四 |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| html | css选择器 | text/attr/outerhtml | attrName |
|
||||
- 获取a标签
|
||||
> ${selectors(resp.html,'a')}
|
||||
- 获取a标签的text
|
||||
> ${selectors(resp.html,'a','text')}
|
||||
- 获取a标签的outerhtml
|
||||
> ${selectors(resp.html,'a','outerhtml')}
|
||||
- 获取a标签的href
|
||||
> ${selectors(resp.html,'a','attr','href')}
|
||||
|
||||
> selector返回的是String,selectors返回的是List<String>
|
||||
|
||||
#### xpath/xpaths
|
||||
|
||||
| 参数一 | 参数二 |
|
||||
| ------ | ------ |
|
||||
| html | xpath |
|
||||
|
||||
- 获取a标签
|
||||
> ${xpaths(resp.html,'//a')}
|
||||
- 获取a标签的href属性
|
||||
> ${xpaths(resp.html,'//a/@href')}
|
||||
|
||||
> xpath返回的是String,xpaths返回的是List<String>
|
||||
|
||||
#### jsonpath
|
||||
|
||||
| 参数一 | 参数二 |
|
||||
| ------ | ------ |
|
||||
| object | jsonpath |
|
||||
|
||||
- 获取 **{"code" : 1}** 中code的值
|
||||
> ${jsonpath(resp.json,'$.code')}
|
||||
|
||||
#### regx/regxs
|
||||
|
||||
| 参数一 | 参数二 |
|
||||
| ------ | ------ |
|
||||
| String | regx |
|
||||
|
||||
- 获取页面标题
|
||||
> ${regxs(resp.html,'<title>(.*?)</title>')}
|
||||
> regx返回的是String,regxs返回的是List<String>
|
||||
|
Loading…
Reference in New Issue
Block a user