安装

  1. set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
  2. npm i puppeteer

截图

  1. const puppeteer = require('puppeteer');
  2. (
  3. async () => {
  4. const browser = await puppeteer.launch();
  5. const page = await browser.newPage();
  6. await page.goto('http://jira.zmops.cc/browse/TK-880');
  7. await page.screenshot({ path: 'example.png' });
  8. await browser.close();
  9. }
  10. )();