拿到response之后,进行各种处理
- select a, b, c from json // 如果要处理的string是json格式,则返回属性为a,b,c的新object(如果json是数组,则返回对象数组,相当于map),可以通过as重命名属性
- select replace(a, '1', '2') from json //从json中读取a属性,并将1替换成2
- insert into demo () values() // 将数据写入到demo表中,没有表则创建表
- download from xxx // xxx必须是string,或者string[], 将下载这些内容
- request getAttr('#xxx', 'href')
- select text('a') from (select b from datasource) // 支持复合查询,比如json的属性值是html (完成一半,目前功能是通过2次执行实现的);支持子查询
- select text('.content') from dom if exist('#xxx') then goto getAttr('#xxx', 'href'), loop();
当context是元素时,方法可以不用传元素选择器
- select text('#id1') from context // 当context是element时 在element下找到id="id1"的元素,返回text 等价于 select text() from (select element("#id1") from context)
- select text() from context // 当context是element时 返回element的text
- select html('.class1') from context // 当context是element时 在element下找到class="class1"的元素,返回html
- select html() from context // 当context是element时 返回element的html
- select getattr("a", "href") from context // 返回a标签的href值
- select getattr("href") from context // 当getattr只有一个参数时,context必须是element
输入:属性名,至少一个参数 输出:object/object[]
- select jobject(a, b, c) from context // 如果要处理的string是json格式,则返回属性为a,b,c的新object(如果json是数组,则返回对象数组,相当于map),可以通过as重命名属性
- select jobject(a) from context // -- 至少要有1个参数 返回类型:object
输入:属性名,仅接受一个参数 输出:string
- select jtext(a) from context // 读取json的a属性,返回类型:string
- 嵌套查询
- 内容分割,的转义