Puppeteer 中文文档v25.8.0

Locator.setTimeout() 方法

通过克隆当前定位器并设置定位器操作的总超时时间,来创建一个新的定位器实例。

传入 0 可禁用超时。

签名

class Locator {
  setTimeout(timeout: number): Locator<T>;
}

参数

参数

类型

说明

timeout

number

返回值:

Locator<T>

默认值:

Page.getDefaultTimeout()