Skip to main content
Version: 24.38.0

WaitForSelectorOptions 接口

🌐 WaitForSelectorOptions interface

语法

🌐 Signature

export interface WaitForSelectorOptions

属性

🌐 Properties

属性

🌐 Property

修饰符

🌐 Modifiers

类型

🌐 Type

描述

🌐 Description

默认

🌐 Default

hidden

optional

boolean

等待所选元素在 DOM 中找不到或被隐藏。有关元素不可见性的定义,请参见 ElementHandle.isHidden()

🌐 Wait for the selected element to not be found in the DOM or to be hidden. See ElementHandle.isHidden() for the definition of element invisibility.

false

signal

optional

AbortSignal

一个信号对象,允许你取消 waitForSelector 调用。

🌐 A signal object that allows you to cancel a waitForSelector call.

timeout

optional

number

等待的最长时间(毫秒)。传入 0 可禁用超时。

🌐 Maximum time to wait in milliseconds. Pass 0 to disable timeout.

默认值可以通过使用 Page.setDefaultTimeout() 来更改

🌐 The default value can be changed by using Page.setDefaultTimeout()

30_000(30秒)

visible

optional

boolean

等待选定的元素在 DOM 中存在并可见。有关元素可见性的定义,请参见 ElementHandle.isVisible()

🌐 Wait for the selected element to be present in DOM and to be visible. See ElementHandle.isVisible() for the definition of element visibility.

false