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: 无显式抛出异常,但内部可能因元素不存在而返回错误信息
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xpath | Yes | ||
| duration | No | ||
| offset_x | Yes | ||
| offset_y | Yes |