OpenSource-Hub

puppeteer

라이브러리

puppeteer/puppeteer

Chrome 및 Firefox 브라우저를 제어하는 JavaScript API。

개요

Puppeteer는 DevTools 프로토콜 또는 WebDriver BiDi를 통해 Chrome 또는 Firefox를 제어하는 고급 API를 제공합니다. 기본적으로 헤드리스로 실행되며, 브라우저 자동화, 테스트 및 웹 크롤링에 널리 사용됩니다. Node.js를 지원하며, 스크린샷, PDF 생성 및 양식 상호작용과 같은 기능을 제공합니다.

README 미리보기

# Puppeteer\n\n[](https://github.com/puppeteer/puppeteer/actions/workflows/ci.yml)\n[](https://npmjs.org/package/puppeteer)\n\n\n\n> Puppeteer is a JavaScript library which provides a high-level API to control\n> Chrome or Firefox over the\n> [DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) or [WebDriver BiDi](https://pptr.dev/webdriver-bidi).\n> Puppeteer runs in the headless (no visible UI) by default\n\n## [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)\n\n## Installation\n\n```bash npm2yarn\nnpm i puppeteer # Downloads compatible Chrome during installation.\nnpm i puppeteer-core # Alternatively, install as a library, without downloading Chrome.\n```\n\n:::note\n\nModern package managers (including npm (see the [RFC](https://github.com/npm/rfcs/pull/868)), pnpm, Yarn, Bun, and Deno) block dependency install scripts by default. If the install script is blocked, Puppeteer will not download the browser during installation, leading to runtime errors.\n\nYou can manually download the required browsers after installation by running:\n\n```bash npm2yarn\nnpx puppeteer browsers install\n```\n\nAlternatively, you can configure your package manager to allow the install script to run (for example, with npm, by adding `"puppeteer"` to `"allowScripts"` in your `package.json`).\n\n:::\n\n## MCP\n\nInstall [`chrome-devtools-mcp`](https://github.com/ChromeDevTools/chrome-devtools-mcp),\na Puppeteer-based MCP server for browser automation and debugging.\n\nPuppeteer also supports the experimental [WebMCP](https://pptr.dev/guides/webmcp) API.\n\n## Example\n\n```ts\nimport puppeteer from 'puppeteer';\n// Or import puppeteer from 'puppeteer-core';\n\n// Launch the browser and open a new blank page.\nconst browser = await puppeteer.launch();\nconst page = await browser.newPage();\n\n// Navigate the page to a UR