-
Notifications
You must be signed in to change notification settings - Fork 2
baidu.com example
dmf-code edited this page May 13, 2020
·
2 revisions
这里以自动化操作百度搜索为例子:
我们要做的是在百度输入框中填写 Python 字符串,然后点击搜索这个流程。
[
{
"component": "request", // 组件名称
"args": { // 参数集合,所有的组件-方法所需要的参数
"url": "https://www.baidu.com"
},
"type": "browser" // 组件的方法,可以不写,默认是 `default`
},
{
"component": "input",
"args": {
"xpath": "//input[@id='kw']",
"text": "Python"
},
"type": "text"
},
{
"component": "click",
"args": {
"xpath": "//input[@id='su']"
}
},
{
"component": "sleep",
"args": {
"time": 3600
}
}
]然后我们进入到 titans 目录下执行如下命令:
python entry.py --type=common --name=common然后我们就可以观察到整个浏览器自动化的流程了。
