drag
Move an HTML element to a specific pixel offset on the page. Provide the element's XPath and desired X/Y offsets; duration can be set for the movement.
Instructions
将元素拖动到指定偏移位置
Args: xpath: 要拖动的元素xpath路径 offset_x: x轴偏移量(像素) offset_y: y轴偏移量(像素) duration: 拖动持续时间(毫秒),默认为1000
Returns: dict: 包含偏移量和持续时间的字典,格式为{"offset_x": int, "offset_y": int, "duration": int} 或 str: 当元素不存在时返回错误信息
Raises: 无显式抛出异常,但内部可能因元素不存在而返回错误信息
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"xpath": "<xpath>",
"offset_x": "<offset_x>",
"offset_y": "<offset_y>"
},
"name": "drag"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xpath | Yes | ||
| duration | No | ||
| offset_x | Yes | ||
| offset_y | Yes |