# class:elementhandle
### class: ElementHandle v0.9.0
> **注意** [ElementHandle](#?product=Puppeteer&version=v1.11.0&show=api-class-elementhandle "ElementHandle") 类继承自 [JSHandle](#?product=Puppeteer&version=v1.11.0&show=api-class-jshandle "JSHandle")。
ElementHandle 表示一个页内的 DOM 元素。ElementHandles 可以通过 [page.$](#?product=Puppeteer&version=v1.11.0&show=api-pageselector) 方法创建。
```
const puppeteer = require('puppeteer');puppeteer.launch().then(async browser => { const page = await browser.newPage(); await page.goto('https://google.com'); const inputElement = await page.$('input[type=submit]'); await inputElement.click(); // ...});
```
除非处理了句柄 [disposed](#?product=Puppeteer&version=v1.11.0&show=api-elementhandledispose),否则 ElementHandle 会阻止垃圾收集中的 DOM 元素。 ElementHandles 在其原始帧被导航时将会自动处理。
ElementHandle 实例可以在 [`page.$eval()`](#?product=Puppeteer&version=v1.11.0&show=api-pageevalselector-pagefunction-args) 和 [`page.evaluate()`](#?product=Puppeteer&version=v1.11.0&show=api-pageevaluatepagefunction-args) 方法中作为参数。
#### Methods
- [elementHandle.$(selector)](#?product=Puppeteer&version=v1.11.0&show=api-elementhandleselector)v0.9.0
- [elementHandle.$$(selector)](#?product=Puppeteer&version=v1.11.0&show=api-elementhandleselector-1)v0.9.0
- [elementHandle.$eval(selector, pageFunction, ...args)](#?product=Puppeteer&version=v1.11.0&show=api-elementhandleevalselector-pagefunction-args)v0.9.0
- [elementHandle.$$eval(selector, pageFunction, ...args)](#?product=Puppeteer&version=v1.11.0&show=api-elementhandleevalselector-pagefunction-args-1)v0.9.0
- [elementHandle.$x(expression)](#?product=Puppeteer&version=v1.11.0&show=api-elementhandlexexpression)v0.9.0
- [elementHandle.asElement()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandleaselement)v0.9.0
- [elementHandle.boundingBox()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandleboundingbox)v0.9.0
- [elementHandle.boxModel()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandleboxmodel)v0.9.0
- [elementHandle.click(\[options\])](#?product=Puppeteer&version=v1.11.0&show=api-elementhandleclickoptions)v0.9.0
- [elementHandle.contentFrame()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandlecontentframe)v0.9.0
- [elementHandle.dispose()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandledispose)v0.9.0
- [elementHandle.executionContext()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandleexecutioncontext)v0.9.0
- [elementHandle.focus()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandlefocus)v0.9.0
- [elementHandle.getProperties()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandlegetproperties)v0.9.0
- [elementHandle.getProperty(propertyName)](#?product=Puppeteer&version=v1.11.0&show=api-elementhandlegetpropertypropertyname)v0.9.0
- [elementHandle.hover()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandlehover)v0.9.0
- [elementHandle.isIntersectingViewport()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandleisintersectingviewport)v0.9.0
- [elementHandle.jsonValue()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandlejsonvalue)v0.9.0
- [elementHandle.press(key\[, options\])](#?product=Puppeteer&version=v1.11.0&show=api-elementhandlepresskey-options)v0.9.0
- [elementHandle.screenshot(\[options\])](#?product=Puppeteer&version=v1.11.0&show=api-elementhandlescreenshotoptions)v0.9.0
- [elementHandle.tap()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandletap)v0.9.0
- [elementHandle.toString()](#?product=Puppeteer&version=v1.11.0&show=api-elementhandletostring)v0.9.0
- [elementHandle.type(text\[, options\])](#?product=Puppeteer&version=v1.11.0&show=api-elementhandletypetext-options)v0.9.0
- [elementHandle.uploadFile(...filePaths)](#?product=Puppeteer&version=v1.11.0&show=api-elementhandleuploadfilefilepaths)v0.9.0
### Methods
#### elementHandle.$(selector)v0.9.0
- `selector` <[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String")> 用于选取页面 DOM 元素的 [CSS Selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors)
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<?[ElementHandle](#?product=Puppeteer&version=v1.11.0&show=api-class-elementhandle "ElementHandle")>>
该方法在页面内运行 `element.querySelector`。 如果没有元素匹配选择器,则返回值为 `null`。
#### elementHandle.$$(selector)v0.9.0
- `selector` <[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String")> 用于选取页面 DOM 元素的 [CSS Selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors)
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array")<[ElementHandle](#?product=Puppeteer&version=v1.11.0&show=api-class-elementhandle "ElementHandle")>>>
该方法在页面内运行 `element.querySelectorAll`。 如果没有元素匹配选择器,则返回值为 `[]`。
#### elementHandle.$eval(selector, pageFunction, ...args)v0.9.0
- `selector` <[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String")> 用于选取页面 DOM 元素的 [CSS Selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors)
- `pageFunction` <[function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function "Function")> 在浏览器上下文中执行的函数
- `...args` <...[Serializable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable")|[JSHandle](#?product=Puppeteer&version=v1.11.0&show=api-class-jshandle "JSHandle")> 传递给 `pageFunction` 的参数
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<[Serializable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable")>> Promise which resolves to the return value of `pageFunction`
这个方法在元素中运行 `document.querySelector` 并将它作为第一个参数传递给 `pageFunction`。 如果没有与 `selector` 匹配的元素,则该方法将抛出个错误。
如果 `pageFunction` 返回一个 [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise"),那么 `frame.$eval` 将等待承诺解析并返回它的值。
例子:
```
const tweetHandle = await page.$('.tweet');expect(await tweetHandle.$eval('.like', node => node.innerText)).toBe('100');expect(await tweetHandle.$eval('.retweets', node => node.innerText)).toBe('10');
```
#### elementHandle.$$eval(selector, pageFunction, ...args)v0.9.0
- `selector` <[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String")> 用于选取页面 DOM 元素的 [CSS Selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors)
- `pageFunction` <[function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function "Function")> Function to be evaluated in browser context
- `...args` <...[Serializable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable")|[JSHandle](#?product=Puppeteer&version=v1.11.0&show=api-class-jshandle "JSHandle")> Arguments to pass to `pageFunction`
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<[Serializable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable")>> Promise which resolves to the return value of `pageFunction`
该方法在元素内运行 `document.querySelectorAll`,并将其作为第一个参数传递给 `pageFunction`。 如果没有与 `selector` 匹配的元素,则该方法将抛出一个错误。
如果 `pageFunction` 返回 [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise"),那么`frame.$$eval` 将等待 promise 解析并返回其值。
例子:
```
<div class="feed">
<div class="tweet">Hello!</div>
<div class="tweet">Hi!</div>
</div>
const feedHandle = await page.$('.feed');expect(await feedHandle.$$eval('.tweet', nodes => nodes.map(n => n.innerText)).toEqual(['Hello!', 'Hi!']);
```
#### elementHandle.$x(expression)v0.9.0
- `expression` <[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String")> Expression to [evaluate](https://developer.mozilla.org/en-US/docs/Web/API/Document/evaluate).
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array")<[ElementHandle](#?product=Puppeteer&version=v1.11.0&show=api-class-elementhandle "ElementHandle")>>>
该方法计算相对于 elementHandle 的 XPath 表达式。 如果不存在这样的元素,该方法将解析为一个空的数组。
#### elementHandle.asElement()v0.9.0
- returns: <[ElementHandle](#?product=Puppeteer&version=v1.11.0&show=api-class-elementhandle "ElementHandle")>
#### elementHandle.boundingBox()v0.9.0
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<?[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object")>>
- x <[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number")> 元素的 x 坐标(以像素为单位)。
- y <[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number")> 元素的 y 坐标(以像素为单位)。
- width <[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number")> 元素的像素宽度。
- height <[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number")> 元素的像素高度。
此方法返回元素的边界框(相对于主框架),如果元素不可见,则返回 `null`。
#### elementHandle.boxModel()v0.9.0
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<?[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object")>>
- content <[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array")<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object")>> Content box, represented as an array of {x, y} points.
- padding <[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array")<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object")>> Padding box, represented as an array of {x, y} points.
- border <[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array")<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object")>> Border box, represented as an array of {x, y} points.
- margin <[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array")<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object")>> Margin box, represented as an array of {x, y} points.
- width <[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number")> 元素的宽度.
- height <[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number")> 元素的高度.
改方法返回元素的盒模型,如果元素不可见,则返回 `null`。 盒模型被表示为一组点;每个 Point 都是一个对象 `{x,y}`。 盒模型的点按顺时针排序。
#### elementHandle.click(\[options\])v0.9.0
- `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object")>
- `button` <[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String")> `left`, `right`, 或 `middle`, 默认是 `left`。
- `clickCount` <[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number")> 默认是 1. 见 [UIEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail").
- `delay` <[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number")> `mousedown` 和 `mouseup` 之间等待的时间。 默认是 0。
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")> Promise which resolves when the element is successfully clicked. Promise gets rejected if the element is detached from DOM.
如果需要,此方法将元素滚动到视野中,然后使用 [page.mouse](#?product=Puppeteer&version=v1.11.0&show=api-pagemouse) 单击元素的中心。 如果该元素从 DOM 中分离,则该方法将引发错误。
#### elementHandle.contentFrame()v0.9.0
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<?[Frame](#?product=Puppeteer&version=v1.11.0&show=api-class-frame "Frame")>> 解析为引用 iframe 节点的元素句柄的内容框架,否则为空
#### elementHandle.dispose()v0.9.0
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")> Promise which resolves when the element handle is successfully disposed.
`elementHandle.dispose` 方法用于停止引用元素的句柄。
#### elementHandle.executionContext()v0.9.0
- returns: [ExecutionContext](#?product=Puppeteer&version=v1.11.0&show=api-class-executioncontext "ExecutionContext")
#### elementHandle.focus()v0.9.0
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")>
在元素上调用 [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus)。
#### elementHandle.getProperties()v0.9.0
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map "Map")<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String"), [JSHandle](#?product=Puppeteer&version=v1.11.0&show=api-class-jshandle "JSHandle")>>>
该方法返回一个包含属性名称作为键的映射和属性值的 JSHandle 实例。
```
const listHandle = await page.evaluateHandle(() => document.body.children);const properties = await listHandle.getProperties();const children = [];for (const property of properties.values()) { const element = property.asElement(); if (element) children.push(element);}children; // body持有 elementHandles 给 document.body 的所有子项。
```
#### elementHandle.getProperty(propertyName)v0.9.0
- `propertyName` <[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String")> property to get
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<[JSHandle](#?product=Puppeteer&version=v1.11.0&show=api-class-jshandle "JSHandle")>>
从 objectHandle 中获取一个属性。
#### elementHandle.hover()v0.9.0
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")> Promise which resolves when the element is successfully hovered.
如果需要,此方法将元素滚动到视野中,然后使用 [page.mouse](#?product=Puppeteer&version=v1.11.0&show=api-pagemouse) 将鼠标悬停在元素的中心。 如果元素从 DOM 中分离(不存在),则该方法将抛出一个错误。
#### elementHandle.isIntersectingViewport()v0.9.0
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type "Boolean")>> Resolves to true if the element is visible in the current viewport.
#### elementHandle.jsonValue()v0.9.0
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object")>>
返回对象的JSON表示。 JSON是通过对页面上的对象运行 [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) 生成的,因此 [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) 在puppeteer中。
> **注意** 如果引用的对象不可字符串化,该方法将抛出(一个错误)。
#### elementHandle.press(key\[, options\])v0.9.0
- `key` <[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String")> 按键的名称,例如 `ArrowLeft`。 见 [USKeyboardLayout](https://github.com/GoogleChrome/puppeteer/blob/master/docs/../lib/USKeyboardLayout.js "USKeyboardLayout") 以获取所有键名称的列表。
- `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object")>
- `text` <[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String")> 如果指定,则使用此文本生成输入事件。
- `delay` <[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number")> `keydown` 和 `keyup` 之间等待的时间。默认是 0。
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")>
聚焦元素,然后使用 [`keyboard.down`](#?product=Puppeteer&version=v1.11.0&show=api-keyboarddownkey-options) 和 [`keyboard.up`](#?product=Puppeteer&version=v1.11.0&show=api-keyboardupkey)。
如果 `key` 是一个单独的字符,并且除了 `Shift` 之外没有(其他)修饰键被按下,`keypress` / `input` 事件也会被生成。 可以指定 `text` 选项来强制生成输入事件。
> **注意** 修饰键 DO 会影响 `elementHandle.press`。 按住 Shift 键将以大写形式输入文本。
#### elementHandle.screenshot(\[options\])v0.9.0
- `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object")> 与 [page.screenshot](#?product=Puppeteer&version=v1.11.0&show=api-pagescreenshotoptions) 选项相同。
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")<[Buffer](https://nodejs.org/api/buffer.html#buffer_class_buffer "Buffer")>> Promise which resolves to buffer with captured screenshot.
如果需要,此方法将元素滚动到视图中,然后使用 [page.screenshot](#?product=Puppeteer&version=v1.11.0&show=api-pagescreenshotoptions) 截取元素的屏幕截图。 如果该元素从 DOM 中分离,则该方法将抛出一个错误。
#### elementHandle.tap()v0.9.0
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")> Promise which resolves when the element is successfully tapped. Promise gets rejected if the element is detached from DOM.
如果需要,此方法将元素滚动到视野中,然后使用 [touchscreen.tap](#?product=Puppeteer&version=v1.11.0&show=api-touchscreentapx-y) 在元素的中心点击。 如果该元素从 DOM 中分离,则该方法将抛出一个错误。
#### elementHandle.toString()v0.9.0
- returns: <[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String")>
#### elementHandle.type(text\[, options\])v0.9.0
- `text` <[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String")> 要输入到焦点元素中的文本。
- `options` <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object")>
- `delay` <[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number")> 按键之间的等待时间,默认是 0。
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")>
聚焦元素,然后为文本中的每个字符发送 `keydown`,`keypress` / `input` 和 `keyup` 事件。
按一个特殊的键,像 `Control` 或 `ArrowDown`,使用 [`elementHandle.press`](#?product=Puppeteer&version=v1.11.0&show=api-elementhandlepresskey-options)。
```
elementHandle.type('Hello'); // 立即输入elementHandle.type('World', {delay: 100}); // 慢点输入,像一个用户
```
键入文本字段然后提交表单的例子:
```
const elementHandle = await page.$('input');await elementHandle.type('some text');await elementHandle.press('Enter');
```
#### elementHandle.uploadFile(...filePaths)v0.9.0
- `...filePaths` <...[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "String")> 设置输入这些路径的文件的值。如果某些 `filePaths` 是相对路径,那么它们将被解析为相对于 [当前工作目录](https://nodejs.org/api/process.html#process_process_cwd)。
- returns: <[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise")>
这个方法期望 `elementHandle` 指向一个 [输入元素](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input)。
![](images/pptr.png)
puppeteer.js中文网|class:elementhandle
puppeteer.js中文文档, puppeteer chrome, puppeteer firefox, puppeteer api 中文文档
puppeteer.js中文网包含了Puppeteer中文文档,最新资讯,应用案例等。Puppeteer 是一个 Node 库,它提供了一个高级 API 来通过 DevTools 协议控制 Chromium 或 Chrome。
- Introduction
- 版本记录
- 概要
- puppeteer-vs-puppeteer-core
- 环境变量
- error-handling
- working-with-chrome-extensions
- class:puppeteer
- class:browserfetcher
- class:browser
- class:page
- class:worker
- class:accessibility
- class:keyboard
- class:mouse
- class:touchscreen
- class:tracing
- class:dialog
- class:consolemessage
- class:frame
- class:executioncontext
- class:jshandle
- class:elementhandle
- class:request
- class:response
- class:securitydetails
- class:target
- class:cdpsession
- class:coverage
- class:timeouterror