交互函数
matman的交互函数继承自nightmare,首先具备nightmare原有的交互函数的能力,其次自身封装了一些交互函数
nightmare的交互函数可以参考Interact with the Page
常用的有:
API
作用
来源
.goto(url[, headers])
转到指定页面
nightmare
.back()
回退到上一个页面
nightmare
.forward()
前进到下一个页面
nightmare
.type(selector[, text])
输入文本
nightmare
.scrollTo(top, left)
滑动到指定位置
nightmare
.wait(ms)
等待一段时间后执行下一步操作(毫秒)
nightmare
.wait(selector)
等待指定选择器出现之后执行下一步操作
nightmare
Last updated
Was this helpful?