更新 document.md
This commit is contained in:
parent
b6164135f9
commit
9bed42629e
32
document.md
32
document.md
@ -75,13 +75,21 @@
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| html | css选择器 | text/attr/outerhtml | attrName |
|
||||
- 获取a标签
|
||||
> ${selectors(resp.html,'a')}
|
||||
```javascript
|
||||
${selectors(resp.html,'a')}
|
||||
```
|
||||
- 获取a标签的text
|
||||
> ${selectors(resp.html,'a','text')}
|
||||
```javascript
|
||||
${selectors(resp.html,'a','text')}
|
||||
```
|
||||
- 获取a标签的outerhtml
|
||||
> ${selectors(resp.html,'a','outerhtml')}
|
||||
```javascript
|
||||
${selectors(resp.html,'a','outerhtml')}
|
||||
```
|
||||
- 获取a标签的href
|
||||
> ${selectors(resp.html,'a','attr','href')}
|
||||
```javascript
|
||||
${selectors(resp.html,'a','attr','href')}
|
||||
```
|
||||
|
||||
> selector返回的是String,selectors返回的是List<String>
|
||||
|
||||
@ -92,9 +100,13 @@
|
||||
| html | xpath |
|
||||
|
||||
- 获取a标签
|
||||
> ${xpaths(resp.html,'//a')}
|
||||
```javascript
|
||||
${xpaths(resp.html,'//a')}
|
||||
```
|
||||
- 获取a标签的href属性
|
||||
> ${xpaths(resp.html,'//a/@href')}
|
||||
```javascript
|
||||
${xpaths(resp.html,'//a/@href')}
|
||||
```
|
||||
|
||||
> xpath返回的是String,xpaths返回的是List<String>
|
||||
|
||||
@ -105,7 +117,9 @@
|
||||
| object | jsonpath |
|
||||
|
||||
- 获取 **{"code" : 1}** 中code的值
|
||||
> ${jsonpath(resp.json,'$.code')}
|
||||
```javascript
|
||||
${jsonpath(resp.json,'$.code')}
|
||||
```
|
||||
|
||||
#### regx/regxs
|
||||
|
||||
@ -114,5 +128,7 @@
|
||||
| String | regx |
|
||||
|
||||
- 获取页面标题
|
||||
> ${regxs(resp.html,'<title>(.*?)</title>')}
|
||||
```javascript
|
||||
${regxs(resp.html,'<title>(.*?)</title>')}
|
||||
```
|
||||
> regx返回的是String,regxs返回的是List<String>
|
||||
|
Loading…
Reference in New Issue
Block a user