MyGit

puppeteer/puppeteer

Fork: 9004 Star: 87328 (更新于 2024-06-15 21:39:17)

license: Apache-2.0

Language: TypeScript .

Node.js API for Chrome

最后发布版本: puppeteer-core-v22.11.0 ( 2024-06-12 18:41:37)

官方网址 GitHub网址

Puppeteer

build npm puppeteer package

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.type('.devsite-search-field', 'automate beyond recorder');

// Wait and click on first result.
const searchResultSelector = '.devsite-result-item-link';
await page.waitForSelector(searchResultSelector);
await page.click(searchResultSelector);

// Locate the full title with a unique string.
const textSelector = await page.waitForSelector('text/Customize and automate');
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-06-15 21:35:41)

2024-06-12 18:41:37 puppeteer-core-v22.11.0

2024-06-12 18:41:36 puppeteer-v22.11.0

2024-06-11 19:18:00 puppeteer-core-v22.10.1

2024-06-11 19:17:59 puppeteer-v22.10.1

2024-05-24 15:27:01 puppeteer-core-v22.10.0

2024-05-24 15:27:00 puppeteer-v22.10.0

2024-05-16 17:02:14 puppeteer-core-v22.9.0

2024-05-16 17:02:13 puppeteer-v22.9.0

2024-05-15 14:15:00 puppeteer-core-v22.8.2

2024-05-15 14:14:59 puppeteer-v22.8.2

主题(topics):

automation, chrome, chromium, developer-tools, headless-chrome, node-module, testing, web

puppeteer/puppeteer同语言 TypeScript最近更新仓库

2024-06-23 00:17:40 lobehub/lobe-chat

2024-06-21 17:44:25 janhq/jan

2024-06-18 00:48:54 danny-avila/LibreChat

2024-06-17 01:19:09 amplication/amplication

2024-06-15 14:47:29 open-metadata/OpenMetadata

2024-06-15 03:16:29 langgenius/dify