Puppeteer 中文文档v25.8.0

Locator.scroll() 方法

滚动所定位的元素。

签名

class Locator {
  scroll<ElementType extends Element>(
    this: Locator<ElementType>,
    options?: Readonly<LocatorScrollOptions>,
  ): Promise<void>;
}

参数

参数

类型

说明

this

Locator<ElementType>

options

Readonly<LocatorScrollOptions>

(可选)

返回值:

Promise<void>