Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/GoogleChrome/puppeteer
Node.js API for Chrome
https://github.com/GoogleChrome/puppeteer
automation chrome chromium developer-tools headless-chrome node-module testing web
Last synced: about 1 month ago
JSON representation
Node.js API for Chrome
- Host: GitHub
- URL: https://github.com/GoogleChrome/puppeteer
- Owner: puppeteer
- License: apache-2.0
- Created: 2017-05-09T22:16:13.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T08:31:56.000Z (8 months ago)
- Last Synced: 2024-05-02T05:51:48.904Z (7 months ago)
- Topics: automation, chrome, chromium, developer-tools, headless-chrome, node-module, testing, web
- Language: TypeScript
- Homepage: https://pptr.dev
- Size: 736 MB
- Stars: 86,832
- Watchers: 1,199
- Forks: 8,971
- Open Issues: 292
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.md
- License: LICENSE
- Security: SECURITY.md
- Support: docs/supported-browsers.md
Awesome Lists containing this project
- awesome-fe - **puppeteer**
- awesome-star-libs - GoogleChrome / puppeteer
- awesome-puppeteer - Offical site
- awesome - puppeteer - Headless Chrome Node.js API (JavaScript)
- awesome-regression-testing - Puppeteer - Headless Google Chrome Node API. (Tools and frameworks)
- awesome-regression-testing - Puppeteer - Headless Google Chrome Node API. (Tools and frameworks)
- awesome-puppeteer - GitHub - Official GitHub repository. (Official)
- awesome-browser-automation - Puppeteer - High level API in Node.js to control Chrome. (Tools)
- awesome-web-browsers - Pupeteer
- awesome-f2e-libs - **puppeteer**
- awesome-puppeteer-zh - GitHub - 官方GitHub存储库. (官方 / 贡献)
- awesome-docs - Puppeteer
- awesome-javascript - puppeteer - Headless Chrome Node.js API by official Google Chrome team. (Testing Frameworks / Runner)
README
# Puppeteer
[![build](https://github.com/puppeteer/puppeteer/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/puppeteer/puppeteer/actions/workflows/ci.yml)
[![npm puppeteer package](https://img.shields.io/npm/v/puppeteer.svg)](https://npmjs.org/package/puppeteer)> Puppeteer is a JavaScript library which provides a high-level API to control
> Chrome or Firefox over the
> [DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) or [WebDriver BiDi](https://pptr.dev/webdriver-bidi).
> Puppeteer runs in the headless (no visible UI) by default## [Get started](https://pptr.dev/docs) | [API](https://pptr.dev/api) | [FAQ](https://pptr.dev/faq) | [Contributing](https://pptr.dev/contributing) | [Troubleshooting](https://pptr.dev/troubleshooting)
## Installation
```bash npm2yarn
npm i puppeteer # Downloads compatible Chrome during installation.
npm i puppeteer-core # Alternatively, install as a library, without downloading Chrome.
```## Example
```ts
import puppeteer from 'puppeteer';
// Or import puppeteer from 'puppeteer-core';// Launch the browser and open a new blank page
const browser = await puppeteer.launch();
const page = await browser.newPage();// Navigate the page to a URL.
await page.goto('https://developer.chrome.com/');// Set screen size.
await page.setViewport({width: 1080, height: 1024});// Type into search box.
await page.locator('.devsite-search-field').fill('automate beyond recorder');// Wait and click on first result.
await page.locator('.devsite-result-item-link').click();// Locate the full title with a unique string.
const textSelector = await page
.locator('text/Customize and automate')
.waitHandle();
const fullTitle = await textSelector?.evaluate(el => el.textContent);// Print the full title.
console.log('The title of this blog post is "%s".', fullTitle);await browser.close();
```