官网
https://pptr.dev/
api 与 教程:
https://pptr.dev/#?product=Puppeteer&version=v1.6.0&show=api-class-puppeteer
第三方教程:
https://www.jianshu.com/p/2f04f9d665ce https://jeffjade.com/2017/12/17/134-kinds-of-toss-using-puppeteer/ https://segmentfault.com/a/1190000010736797
安装
$ npm init -y && npm i puppeteer
Demo1: 打开百度并且截图
const puppeteer = require(‘puppeteer‘); // https://pptr.dev/#?product=Puppeteer&version=v1.6.0&show=api-class-page puppeteer.launch().then(async browser => { const page = await browser.newPage(); await page.goto(‘https://www.baidu.com‘); await page.screenshot({path: ‘screenshot.png‘}); await browser.close(); });
puppeteer (Nodejs版selenium )快速入门
原文:https://www.cnblogs.com/CyLee/p/9310839.html