Base URL:http://127.0.0.1:39627/api
searchElement
参数各个属性值描述:
parent
:要查找元素的父级元素的名称selector
:查找元素的selector语句isXPath
:selector语句是否是XPath语句index
:查找到多个元素的时候,选择第几个元素。从0开始searchAllIframe
:是否在iframe里面查找selectorForSearchIframe
:查找iframe的selector语句
请求地址
/environment/list
请求参数
参数 | 类型 | 描述 |
---|---|---|
type | int | 列表类型,0 - 所有环境,1 - 已开启环境,2 - 未开启环境 |
请求参数示例
xxxxxxxxxx
{
"type": 1
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": [
{
"id": "1622109562686",
"name": "cloud_test_3",
"group": "TEST",
"startUrl": "https://www.baidu.com/",
"browserId": 1956,
"currentUrl": "https://www.baidu.com/",
"account": null
},
{
"id": "1622109562675",
"name": "cloud_test_2",
"group": "TEST",
"startUrl": "https://www.facebook.com/",
"browserId": 22980,
"currentUrl": "https://www.facebook.com/",
"account": {
"id": "1622519343036",
"name": "myfacebookaccount",
"password": "myfacebookpassword",
"email": "",
"phone": "",
"cookie": "",
"siteUrl": "https://www.facebook.com/"
}
}
],
"error": null,
"browserNotFound": false
}
请求地址
/environment/start
请求参数
参数 | 类型 | 描述 |
---|---|---|
environmentId | String | 环境id |
请求参数示例
xxxxxxxxxx
{
"environmentId": "1622109562686"
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": null,
"error": null,
"browserNotFound": false
}
请求地址
/environment/close
请求参数
参数 | 类型 | 描述 |
---|---|---|
environmentId | String | 环境id |
browserId | int | 浏览器id |
请求参数示例
xxxxxxxxxx
{
"environmentId": "1622109562686",
"browserId": 0
}
OR
{
"environmentId": null,
"browserId": 22980
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": null,
"error": null,
"browserNotFound": false
}
请求地址
/browser/loadurl
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
url | String | 要加载的网页URL |
newTab | bool | 是否打开新tab页 |
timeout | int | 加载超时时间,单位是秒 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"url": "https://www.qq.com/",
"newTab": true,
"timeout": 30
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": null,
"error": null,
"browserNotFound": false
}
请求地址
/browser/switchtab
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
url | String | 通过此URL查找第一个匹配的tab页 |
lastTab | bool | 是否切换到最后一个tab页 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"url": "www.baidu.com",
"lastTab": false
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": null,
"error": null,
"browserNotFound": false
}
请求地址
/browser/closetab
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
url | String | 通过此URL查找第一个匹配的tab页 |
closeOthers | bool | 是否关闭除匹配到的tab之外的其他所有tab页 |
closeLastTab | bool | 是否关闭最后一个tab页 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"url": "www.baidu.com",
"closeOthers": false,
"closeLastTab": false
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": null,
"error": null,
"browserNotFound": false
}
请求地址
/browser/setcookie
请求参数
参数 | 类型 | 描述 |
---|---|---|
cookie | String | json格式的cookie字符串 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"cookie": "[{\"domain\":\".baidu.com\",\"expirationDate\":3770601752.373181,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"BIDUPSID\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"E12A9B3CE1E0C48F92F0E7D67493AF3B\"},{\"domain\":\".baidu.com\",\"expirationDate\":3770601752.3732,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"PSTM\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"1623118105\"},{\"domain\":\".baidu.com\",\"expirationDate\":1654654105.37321,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"BAIDUID\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"E12A9B3CE1E0C48FFB72E304558B28E5:FG=1\"},{\"domain\":\"www.baidu.com\",\"hostOnly\":true,\"httpOnly\":false,\"name\":\"BD_HOME\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":true,\"storeId\":\"0\",\"value\":\"1\"},{\"domain\":\".baidu.com\",\"hostOnly\":false,\"httpOnly\":false,\"name\":\"H_PS_PSSID\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":true,\"storeId\":\"0\",\"value\":\"31253_33848_33676_33607_26350_22159\"},{\"domain\":\".baidu.com\",\"expirationDate\":1654654106.343895,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"BAIDUID_BFESS\",\"path\":\"/\",\"sameSite\":\"no_restriction\",\"secure\":true,\"session\":false,\"storeId\":\"0\",\"value\":\"E12A9B3CE1E0C48FFB72E304558B28E5:FG=1\"},{\"domain\":\"www.baidu.com\",\"expirationDate\":1623982105,\"hostOnly\":true,\"httpOnly\":false,\"name\":\"BD_UPN\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"12314753\"},{\"domain\":\".baidu.com\",\"expirationDate\":1623121706,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"BA_HECTOR\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"2180ag840485al8hmh1gbtk8q0r\"}]"
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": null,
"error": null,
"browserNotFound": false
}
请求地址
/browser/getcookie
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
|url|String
|指定要获取的cookie的网站地址|=
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"url": "https://www.baidu.com/"
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": "[{\"domain\":\".baidu.com\",\"expirationDate\":3770601752.373181,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"BIDUPSID\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"E12A9B3CE1E0C48F92F0E7D67493AF3B\"},{\"domain\":\".baidu.com\",\"expirationDate\":3770601752.3732,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"PSTM\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"1623118105\"},{\"domain\":\".baidu.com\",\"expirationDate\":1654654105.37321,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"BAIDUID\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"E12A9B3CE1E0C48FFB72E304558B28E5:FG=1\"},{\"domain\":\"www.baidu.com\",\"hostOnly\":true,\"httpOnly\":false,\"name\":\"BD_HOME\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":true,\"storeId\":\"0\",\"value\":\"1\"},{\"domain\":\".baidu.com\",\"hostOnly\":false,\"httpOnly\":false,\"name\":\"H_PS_PSSID\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":true,\"storeId\":\"0\",\"value\":\"31253_33848_33676_33607_26350_22159\"},{\"domain\":\".baidu.com\",\"expirationDate\":1654654106.343895,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"BAIDUID_BFESS\",\"path\":\"/\",\"sameSite\":\"no_restriction\",\"secure\":true,\"session\":false,\"storeId\":\"0\",\"value\":\"E12A9B3CE1E0C48FFB72E304558B28E5:FG=1\"},{\"domain\":\"www.baidu.com\",\"expirationDate\":1623982105,\"hostOnly\":true,\"httpOnly\":false,\"name\":\"BD_UPN\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"12314753\"},{\"domain\":\".baidu.com\",\"expirationDate\":1623121706,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"BA_HECTOR\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"2180ag840485al8hmh1gbtk8q0r\"}]",
"error": null,
"browserNotFound": false
}
请求地址
/browser/getallcookies
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": "[{\"domain\":\".baidu.com\",\"expirationDate\":3770603360.986113,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"PSTM\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"1623119714\"},{\"domain\":\".baidu.com\",\"expirationDate\":1654655713.986123,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"BAIDUID\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"035813153AF4AB0ABA38DBFD12E5EC42:FG=1\"},{\"domain\":\"www.baidu.com\",\"hostOnly\":true,\"httpOnly\":false,\"name\":\"BD_HOME\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":true,\"storeId\":\"0\",\"value\":\"1\"},{\"domain\":\".baidu.com\",\"hostOnly\":false,\"httpOnly\":false,\"name\":\"H_PS_PSSID\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":true,\"storeId\":\"0\",\"value\":\"34004_33607_26350\"},{\"domain\":\".baidu.com\",\"expirationDate\":2632271713,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"BIDUPSID\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"E12A9B3CE1E0C48F92F0E7D67493AF3B\"},{\"domain\":\"www.baidu.com\",\"expirationDate\":1623983714,\"hostOnly\":true,\"httpOnly\":false,\"name\":\"BD_UPN\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"12314753\"},{\"domain\":\".baidu.com\",\"expirationDate\":1623123314,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"BA_HECTOR\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"a02l04258h0l2g20gm1gbtlr20r\"},{\"domain\":\".qq.com\",\"hostOnly\":false,\"httpOnly\":false,\"name\":\"pgv_info\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":true,\"storeId\":\"0\",\"value\":\"ssid=s6826192643\"},{\"domain\":\".www.qq.com\",\"expirationDate\":1623121517,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"ts_last\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"www.qq.com/\"},{\"domain\":\".qq.com\",\"expirationDate\":2147385600,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"pgv_pvid\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"9261427969\"},{\"domain\":\".www.qq.com\",\"expirationDate\":1686191717,\"hostOnly\":false,\"httpOnly\":false,\"name\":\"ts_uid\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"134862111\"},{\"domain\":\"www.qq.com\",\"expirationDate\":1623206117,\"hostOnly\":true,\"httpOnly\":false,\"name\":\"ad_play_index\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"24\"},{\"domain\":\".l.qq.com\",\"expirationDate\":2145887999.404651,\"hostOnly\":false,\"httpOnly\":true,\"name\":\"lv_play_index\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"92\"},{\"domain\":\".l.qq.com\",\"expirationDate\":2145888000.343521,\"hostOnly\":false,\"httpOnly\":true,\"name\":\"appuser\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"4B0D7D315C9F16CC\"},{\"domain\":\".tj.video.qq.com\",\"hostOnly\":false,\"httpOnly\":false,\"name\":\"lv_irt_id\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":true,\"storeId\":\"0\",\"value\":\"7bba9392c58db70e3cd403c72a1007a3\"},{\"domain\":\".l.qq.com\",\"expirationDate\":2145888000.34347,\"hostOnly\":false,\"httpOnly\":true,\"name\":\"o_minduid\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"01GQEVG38T6tNi2FrAhHO38qQSk_W1v5\"},{\"domain\":\".l.qq.com\",\"expirationDate\":1623206118.34354,\"hostOnly\":false,\"httpOnly\":true,\"name\":\"Lturn\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"776\"},{\"domain\":\".l.qq.com\",\"expirationDate\":1623206118.343554,\"hostOnly\":false,\"httpOnly\":true,\"name\":\"LKBturn\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"878\"},{\"domain\":\".l.qq.com\",\"expirationDate\":1623206118.343565,\"hostOnly\":false,\"httpOnly\":true,\"name\":\"LPVLturn\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"503\"},{\"domain\":\".l.qq.com\",\"expirationDate\":1623206118.343576,\"hostOnly\":false,\"httpOnly\":true,\"name\":\"LPLFturn\",\"path\":\"/\",\"sameSite\":\"unspecified\",\"secure\":false,\"session\":false,\"storeId\":\"0\",\"value\":\"205\"}]",
"error": null,
"browserNotFound": false
}
请求地址
/browser/clearcookies
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": null,
"error": null,
"browserNotFound": false
}
请求地址
/browser/getimage
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
filePath | String | 保存到本地的路径,图片格式为png |
elementScreenshot | bool | 是否截取元素图片 |
searchElement | Object | 查找元素的条件设置 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"filePath": "C:\\Users\\RHKJ008\\Desktop\\getimagetest.png",
"elementScreenshot": false,
"searchElement": null
}
OR
{
"browserId": 22980,
"filePath": "C:\\Users\\RHKJ008\\Desktop\\getimagetest.png",
"elementScreenshot": true,
"searchElement": {
"parent": null,
"selector": "*[id='lg']",
"isXPath": false,
"index": 0,
"searchAllIframe": false,
"selectorForSearchIframe": null
}
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": "C:\\Users\\RHKJ008\\Desktop\\getimagetest.png",
"error": null,
"browserNotFound": false
}
请求地址
/browser/executejs
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
js | String | 要执行的js |
inIframe | bool | 是否在jframe里执行 |
selectorForIframe | String | 查找iframe的selector语句 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"js": "alert('hello world')",
"inIframe": false,
"selectorForIframe": null
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": null,
"error": null,
"browserNotFound": false
}
请求地址
/browser/findelement
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
searchElement | Object | 查找元素的条件设置 |
saveElementName | String | 给找到的元素指定一个名称,在"抓取文本"、“设置值”等方法里可以通过设置elementName来直接使用元素 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"searchElement": {
"parent": null,
"selector": "span.soutu-btn",
"isXPath": false,
"index": 0,
"searchAllIframe": false,
"selectorForSearchIframe": null
},
"saveElementName": "btnSoutu"
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": "btnSoutu",
"error": null,
"browserNotFound": false
}
请求地址
/browser/pageloadwait
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
searchElement | Object | 查找元素的条件设置 |
loop | int | 循环次数 |
sleep | String | 每次循环的间隔时间,单位是秒 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"searchElement": {
"parent": null,
"selector": "span.soutu-btn",
"isXPath": false,
"index": 0,
"searchAllIframe": false,
"selectorForSearchIframe": null
},
"saveElementName": "btnSoutu",
"loop": 10,
"sleep": 5
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": null,
"error": null,
"browserNotFound": false
}
请求地址
/browser/scrapespecialtext
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
specialText | int | 特殊文本类型,0 - 网页源码,1 - 网页标题,2 - 网页Body内容,3 - 网页URL |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"specialText": 3
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": "https://www.baidu.com/",
"error": null,
"browserNotFound": false
}
请求地址
/browser/scrapeonetext
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
elementName | String | 在使用“查找元素”和“等待页面加载”方法后查找到的元素的名称,使用searchElement 的时候设置为null |
searchAllIframe | bool | 是否在所有iframe里查找,与elementName一起使用 |
searchElement | Object | 查找元素的条件设置。使用elementName的时候设置为null |
property | String | 属性名称 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"elementName": null,
"searchAllIframe": false,
"searchElement": {
"parent": null,
"selector": "*[id='su']",
"isXPath": false,
"index": 0,
"searchAllIframe": false,
"selectorForSearchIframe": null
},
"property": "value"
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": "百度一下",
"error": null,
"browserNotFound": false
}
请求地址
/browser/scrapesometext
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
searchElement | Object | 查找元素的条件设置 |
property | String | 属性名称 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"searchElement": {
"parent": null,
"selector": "a.mnav",
"isXPath": false,
"index": 0,
"searchAllIframe": false,
"selectorForSearchIframe": null
},
"property": "textContent"
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": ["新闻","hao123","地图","直播","视频","贴吧","学术"],
"error": null,
"browserNotFound": false
}
请求地址
/browser/setvalue
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
elementName | String | 在使用“查找元素”和“等待页面加载”方法后查找到的元素的名称,使用searchElement 的时候设置为null |
searchAllIframe | bool | 是否在所有iframe里查找,与elementName一起使用 |
searchElement | Object | 查找元素的条件设置。使用elementName的时候设置为null |
property | String | 属性名称 |
value | String | 要设置的值 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"elementName": null,
"searchAllIframe": false,
"searchElement": {
"parent": null,
"selector": "input[id='kw']",
"isXPath": false,
"index": 0,
"searchAllIframe": false,
"selectorForSearchIframe": null
},
"property": "value",
"value": "API测试"
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": null,
"error": null,
"browserNotFound": false
}
请求地址
/browser/keystrokesemulation
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
text | String | 输入的文本 |
isSpecialKey | bool | 是否输入特殊按键 |
specialKey | int | 特殊按键,0 - TAB,1 - ENTER,2 - UP,3 - DOWN,4 - LEFT,5 - RIGHT,6 - HOME,7 - END,8 - PAGE UP,9 - PAGE DOWN,10 - BACKSPACE,11 - DELETE,12 - ESC |
sendTimes | int | 特殊按键输入次数 |
minInterval | int | 输入每个字符的最小间隔事件,单位是毫秒 |
maxInterval | int | 输入每个字符的最大间隔事件,单位是毫秒 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"text": "API测试",
"isSpecialKey": false,
"specialKey": 0,
"sendTimes": 0,
"minInterval": 50,
"maxInterval": 100
}
OR
{
"browserId": 22980,
"text": null,
"isSpecialKey": true,
"specialKey": 1,
"sendTimes": 2,
"minInterval": 50,
"maxInterval": 100
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": null,
"error": null,
"browserNotFound": false
}
请求地址
/browser/elementoperate
请求参数
参数 | 类型 | 描述 |
---|---|---|
browserId | int | 浏览器id |
elementName | String | 在使用“查找元素”和“等待页面加载”方法后查找到的元素的名称,使用searchElement 的时候设置为null |
searchAllIframe | bool | 是否在所有iframe里查找,与elementName一起使用 |
searchElement | Object | 查找元素的条件设置。使用elementName的时候设置为null |
operateType | int | 操作类型,0 - Event,执行元素的eventName事件,1 - Click,2 - DoubleClick,3 - MouseClick,4 - MouseRightClick,5 - MouseDoubleClick,6 - MouseMove,7 - Touch,8 - ScrollTop,9 - ScrollBottom |
eventName | String | 事件名称,比如click,focus。operateType为0的时候必填 |
moveTime | int | operateType为MouseMove时的移动持续时间,单位为秒 |
请求参数示例
xxxxxxxxxx
{
"browserId": 22980,
"elementName": null,
"searchAllIframe": false,
"searchElement": {
"parent": null,
"selector": "span.soutu-btn",
"isXPath": false,
"index": 0,
"searchAllIframe": false,
"selectorForSearchIframe": null
},
"operateType": 3,
"eventName": null,
"moveTime": 0
}
返回结果示例
xxxxxxxxxx
{
"success": true,
"result": null,
"error": null,
"browserNotFound": false
}