首先我们要编写自动化操作命令:
[
{
"component": "request",
"args": {
"url": "https://www.baidu.com"
},
"type": "browser"
},
{
"component": "input",
"args": {
"xpath": "//input[@id='kw']",
"text": "Python"
},
"type": "text"
},
{
"component": "click",
"args": {
"xpath": "//input[@id='su']"
}
},
{
"component": "sleep",
"args": {
"time": 5
}
}
]
上面配置翻译出来的意思就是
- 请求百度
url
- 在
input
输入框填写Python
文本 - 点击搜索按钮
- 睡眠等待5秒,防止执行完成后立刻退出浏览器无法观察效果
具体效果:
Titans
框架 Github Page
: https://dmf-code.github.io/titans/
Titans
框架 wiki
文档: https://github.com/dmf-code/titans/wiki