puppeteer/puppeteer
Fork: 9025 Star: 87724 (更新于 2024-07-22 13:34:27)
license: Apache-2.0
Language: TypeScript .
Node.js API for Chrome
最后发布版本: browsers-v2.2.4 ( 2024-07-17 17:12:14)
Puppeteer
![](https://user-images.githubusercontent.com/10379601/29446482-04f7036a-841f-11e7-9872-91d1fc2ea683.png)
Puppeteer is a Node.js library which provides a high-level API to control Chrome or Firefox over the DevTools Protocol or WebDriver BiDi. Puppeteer runs in the headless (no visible UI) by default but can be configured to run in a visible ("headful") browser.
Get started | API | FAQ | Contributing | Troubleshooting
Installation
npm i puppeteer # Downloads compatible Chrome during installation.
npm i puppeteer-core # Alternatively, install as a library, without downloading Chrome.
Example
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();
最近版本更新:(数据更新于 2024-07-22 13:31:39)
2024-07-17 17:12:14 browsers-v2.2.4
2024-07-17 17:12:13 puppeteer-core-v22.13.1
2024-07-17 17:12:12 puppeteer-v22.13.1
2024-07-11 17:20:01 puppeteer-core-v22.13.0
2024-07-11 17:20:00 puppeteer-v22.13.0
2024-06-26 20:03:49 puppeteer-core-v22.12.1
2024-06-26 20:03:48 puppeteer-v22.12.1
2024-06-21 15:46:25 puppeteer-core-v22.12.0
2024-06-21 15:46:25 puppeteer-v22.12.0
2024-06-21 03:36:31 ng-schematics-v0.6.1
主题(topics):
automation, chrome, chromium, developer-tools, headless-chrome, node-module, testing, web
puppeteer/puppeteer同语言 TypeScript最近更新仓库
2024-07-27 00:01:38 immich-app/immich
2024-07-26 22:29:23 microsoft/TypeScript
2024-07-26 21:03:07 siyuan-note/siyuan
2024-07-26 19:29:18 lobehub/lobe-chat
2024-07-26 19:25:53 ChatGPTNextWeb/ChatGPT-Next-Web
2024-07-26 17:54:37 element-plus/element-plus