puppeteer/assets/js/03a88bad.8911393c.js

2 lines
18 KiB
JavaScript
Raw Normal View History

/*! For license information please see 03a88bad.8911393c.js.LICENSE.txt */
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[26568],{56142:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>p,contentTitle:()=>i,default:()=>c,frontMatter:()=>o,metadata:()=>a,toc:()=>l});var t=n(85893),s=n(11151);const o={},i="Puppeteer",a={id:"index",title:"Puppeteer",description:"Build status",source:"@site/../docs/index.md",sourceDirName:".",slug:"/",permalink:"/next/",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"docs",next:{title:"Guides",permalink:"/next/category/guides"}},p={},l=[{value:"Guides | API | FAQ | Contributing | Troubleshooting",id:"guides--api--faq--contributing--troubleshooting",level:4},{value:"What can I do?",id:"what-can-i-do",level:4},{value:"Getting Started",id:"getting-started",level:2},{value:"Installation",id:"installation",level:3},{value:"Configuration",id:"configuration",level:4},{value:"<code>puppeteer-core</code>",id:"puppeteer-core",level:4},{value:"Usage",id:"usage",level:3},{value:"Example",id:"example",level:4},{value:"Default runtime settings",id:"default-runtime-settings",level:3},{value:"Using Docker",id:"using-docker",level:4},{value:"Using Chrome Extensions",id:"using-chrome-extensions",level:4},{value:"Resources",id:"resources",level:2},{value:"Contributing",id:"contributing",level:2},{value:"FAQ",id:"faq",level:2}];function h(e){const r={a:"a",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.h1,{id:"puppeteer",children:"Puppeteer"}),"\n",(0,t.jsxs)(r.p,{children:[(0,t.jsx)(r.a,{href:"https://github.com/puppeteer/puppeteer/actions?query=workflow%3ACI",children:(0,t.jsx)(r.img,{src:"https://github.com/puppeteer/puppeteer/workflows/CI/badge.svg",alt:"Build status"})}),"\n",(0,t.jsx)(r.a,{href:"https://npmjs.org/package/puppeteer",children:(0,t.jsx)(r.img,{src:"https://img.shields.io/npm/v/puppeteer.svg",alt:"npm puppeteer package"})})]}),"\n",(0,t.jsx)("img",{src:"https://user-images.githubusercontent.com/10379601/29446482-04f7036a-841f-11e7-9872-91d1fc2ea683.png",height:"200",align:"right"}),"\n",(0,t.jsxs)(r.h4,{id:"guides--api--faq--contributing--troubleshooting",children:[(0,t.jsx)(r.a,{href:"https://pptr.dev/category/guides",children:"Guides"})," | ",(0,t.jsx)(r.a,{href:"https://pptr.dev/api",children:"API"})," | ",(0,t.jsx)(r.a,{href:"https://pptr.dev/faq",children:"FAQ"})," | ",(0,t.jsx)(r.a,{href:"https://pptr.dev/contributing",children:"Contributing"})," | ",(0,t.jsx)(r.a,{href:"https://pptr.dev/troubleshooting",children:"Troubleshooting"})]}),"\n",(0,t.jsxs)(r.blockquote,{children:["\n",(0,t.jsxs)(r.p,{children:["Puppeteer is a Node.js library which provides a high-level API to control\nChrome/Chromium over the\n",(0,t.jsx)(r.a,{href:"https://chromedevtools.github.io/devtools-protocol/",children:"DevTools Protocol"}),".\nPuppeteer runs in\n",(0,t.jsx)(r.a,{href:"https://developer.chrome.com/articles/new-headless/",children:"headless"}),'\nmode by default, but can be configured to run in full ("headful")\nChrome/Chromium.']}),"\n"]}),"\n",(0,t.jsx)(r.h4,{id:"what-can-i-do",children:"What can I do?"}),"\n",(0,t.jsx)(r.p,{children:"Most things that you can do manually in the browser can be done using Puppeteer!\nHere are a few examples to get you started:"}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsx)(r.li,{children:"Generate screenshots and PDFs of pages."}),"\n",(0,t.jsx)(r.li,{children:'Crawl a SPA (Single-Page Application) and generate pre-rendered content (i.e.\n"SSR" (Server-Side Rendering)).'}),"\n",(0,t.jsx)(r.li,{children:"Automate form submission, UI testing, keyboard input, etc."}),"\n",(0,t.jsx)(r.li,{children:"Create an automated testing environment using the latest JavaScript and\nbrowser features."}),"\n",(0,t.jsxs)(r.li,{children:["Capture a\n",(0,t.jsx)(r.a,{href:"https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/reference",children:"timeline trace"}),"\nof your site to help diagnose performance issues."]}),"\n",(0,t.jsxs