waitForSelector
Pause execution until a specified element, identified by a CSS selector or XPath, appears on the webpage, with configurable timeout and state conditions for precise control.
Instructions
等待指定选择器的元素出现
Input Schema
Name | Required | Description | Default |
---|---|---|---|
pageId | Yes | 页面ID | |
selector | Yes | CSS选择器或xp引用值 | |
state | No | 等待的状态(默认visible) | |
timeout | No | 超时时间(毫秒,默认30000) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"pageId": {
"description": "页面ID",
"type": "string"
},
"selector": {
"description": "CSS选择器或xp引用值",
"type": "string"
},
"state": {
"description": "等待的状态(默认visible)",
"enum": [
"attached",
"detached",
"visible",
"hidden"
],
"type": "string"
},
"timeout": {
"description": "超时时间(毫秒,默认30000)",
"type": "number"
}
},
"required": [
"pageId",
"selector"
],
"type": "object"
}