ajhsu / blog

The external storage of my brain.
3 stars 0 forks source link

Puppeteer #76

Open ajhsu opened 6 years ago

ajhsu commented 6 years ago

Puppeteer

Puppeteer is a Node library which provides a high-level API to control Chromium or Chrome over the DevTools Protocol.

Overview

The Puppeteer API is hierarchical and mirrors the browser structure. On the following diagram, faded entities are not currently represented in Puppeteer.

puppeteer overview

Class Browser

A Browser is created when Puppeteer connects to a Chromium instance

Class Page

Page provides methods to interact with a single tab in Chromium. One Browser instance might have multiple Page instances.

Class Frame

At every point of time, page exposes its current frame tree via the page.mainFrame() and frame.childFrames() methods.

Reference