web_wait_for
网页自动化 · macOS · Windows
效果: 写入. 状态: 受限可用.
“受限可用”表示工具可能取决于版本、平台、权限、账户或配置,并不表示它在所有安装中都已启用。
macOS
用途
等待(通过轮询,而不是固定 sleep),直到元素出现在页面上或超时。适用于加载后才进行 hydrate 的 SPA 页面。优先使用 `selector`(CSS 选择器,例如“input[name=password]”)。`condition` 也接受“document.querySelector('...')”形式;任何其他 JavaScript 条件都会在页面上运行任意代码(权限等同 web_eval),并在 LMCP 处于只读模式时禁用。返回 met:true/false。
必填输入
此平台的架构未声明必填输入,但仍可能存在可选选择器或运行时要求。
权限与确认
架构未声明明确的确认参数。这并不代表可以未经许可操作;请检查效果并取得授权。
- 仅使用用户在此平台上授权的应用、账户和资源。请查阅此工具针对平台的说明,以了解其连接和权限要求;本目录不声称需要额外的 OAuth 范围或操作系统授权。
英文规范技术架构 — macOS
{
"properties": {
"condition": {
"description": "Alternative to selector: \"document.querySelector('...')\" is accepted as-is; any other JS expression runs arbitrary code on the page (same power as web_eval).",
"type": "string"
},
"selector": {
"description": "CSS selector to wait for (preferred; treated as data, never executed). e.g. .feed",
"type": "string"
},
"session": {
"description": "Session name (default 'default').",
"type": "string"
},
"timeout_seconds": {
"description": "Max seconds to wait (default 15).",
"type": "integer"
}
},
"required": [],
"type": "object"
}文档示例
web_wait_for 的文档示例。请勿执行此示例。所示参数属于虚构数据集;在实际调用前,请解析真实标识符并获得授权。
{
"selector": "h1",
"session": "demo-browser"
}Windows
用途
等待(通过轮询,而不是固定 sleep),直到元素出现(或页面条件成立)或超时。优先使用 `selector` 参数:将 CSS 选择器作为数据等待(例如 selector “input[name=password]”)。为兼容性,`condition` 也接受已记录的“document.querySelector('SEL')”形式,或接受任何其他要在页面上求值的 JavaScript。返回 met:true/false。
必填输入
此平台的架构未声明必填输入,但仍可能存在可选选择器或运行时要求。
权限与确认
架构未声明明确的确认参数。这并不代表可以未经许可操作;请检查效果并取得授权。
- 仅使用用户在此平台上授权的应用、账户和资源。请查阅此工具针对平台的说明,以了解其连接和权限要求;本目录不声称需要额外的 OAuth 范围或操作系统授权。
英文规范技术架构 — Windows
{
"properties": {
"condition": {
"description": "Alternative to selector: \"document.querySelector('SEL')\" (compat), or any other JavaScript.",
"type": "string"
},
"selector": {
"description": "CSS selector to wait for (preferred; treated as data, never executed). e.g. .feed, input[name=password]",
"type": "string"
},
"session": {
"description": "Session name (default 'default').",
"type": "string"
},
"timeout_seconds": {
"description": "Max seconds to wait (default 15).",
"type": "integer"
}
},
"required": [],
"type": "object"
}文档示例
web_wait_for 的文档示例。请勿执行此示例。所示参数属于虚构数据集;在实际调用前,请解析真实标识符并获得授权。
{
"selector": "h1",
"session": "demo-browser"
}