跳到正文
所有工具

web_type

网页自动化 · macOS · Windows

效果: 写入. 状态: 受限可用.

“受限可用”表示工具可能取决于版本、平台、权限、账户或配置,并不表示它在所有安装中都已启用。

macOS

用途

在当前页面的表单字段(input/textarea)或富文本编辑器(contenteditable 元素)中输入文本。`target` 是 CSS 选择器,或字段的可见标签/占位符。页面自身的脚本运行后会回读该字段:如果其最终内容不同(掩码,或拒绝了该文本的编辑器),调用会以 `not_applied` 失败,并返回该字段当前的值。不会提交——之后请对提交按钮使用 web_click(该步骤受关卡控制)。特殊情况——文件输入框:如果 `target` 解析为 <input type="file">,则 `text` 会被当作这台 Mac 上的本地文件路径,并附加该文件(JS 无法直接设置文件输入框的值;这会以编程方式应答原生文件面板,而不会显示它)。未传 confirm 时返回预览,不输入任何内容;传入 confirm=true 才会输入。

必填输入

输入名称会严格保持工具要求的形式。下方可展开的架构中保留英文规范技术定义。

权限与确认

架构声明了明确的确认参数。请检查预览,并按此平台的契约授权实际操作。

英文规范技术架构 — macOS
{
  "properties": {
    "confirm": {
      "description": "Must be true to type. Without it, returns a preview and types nothing.",
      "type": "boolean"
    },
    "session": {
      "description": "Session name (default 'default').",
      "type": "string"
    },
    "target": {
      "description": "CSS selector or visible label/placeholder of the field.",
      "type": "string"
    },
    "text": {
      "description": "The text to type. For an input[type=file], this is instead the LOCAL FILE PATH to upload.",
      "type": "string"
    }
  },
  "required": [
    "target",
    "text"
  ],
  "type": "object"
}

文档示例

web_type 的文档示例。请勿执行此示例。所示参数属于虚构数据集;在实际调用前,请解析真实标识符并获得授权。

{
  "confirm": false,
  "session": "demo-browser",
  "target": "input[name='search']",
  "text": "launch checklist"
}

Windows

用途

向当前页面的表单字段(input/textarea)输入文本。`target` 是 CSS 选择器或字段的可见标签/占位符。不会提交表单;之后请对提交按钮使用 web_click(该步骤受确认门控)。

必填输入

输入名称会严格保持工具要求的形式。下方可展开的架构中保留英文规范技术定义。

权限与确认

架构未声明明确的确认参数。这并不代表可以未经许可操作;请检查效果并取得授权。

英文规范技术架构 — Windows
{
  "properties": {
    "session": {
      "description": "Session name (default 'default').",
      "type": "string"
    },
    "target": {
      "description": "CSS selector or visible label/placeholder of the field.",
      "type": "string"
    },
    "text": {
      "description": "The text to type.",
      "type": "string"
    }
  },
  "required": [
    "target",
    "text"
  ],
  "type": "object"
}

文档示例

web_type 的文档示例。请勿执行此示例。所示参数属于虚构数据集;在实际调用前,请解析真实标识符并获得授权。

{
  "session": "demo-browser",
  "target": "input[name='search']",
  "text": "launch checklist"
}