小编ARU*_*SON的帖子

Puppeteer - 未处理的PromiseRejectionWarning

我尝试使用木偶师,

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://10.1.40.117/print/d37a2017-4bc4-46fb-9a8a-7ddc31e65a33', {waitUntil: 'networkidle2'});
  await page.pdf({path: 'hn.pdf', format: 'A4'});

  await browser.close();
})();
Run Code Online (Sandbox Code Playgroud)

出现以下错误,

(node:16064) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: net::ERR_CERT_AUTHORITY_INVALID at https://10.1.40.117/print/d37a2017-4bc4-46fb-9a8a-7ddc31e65a33
(node:16064) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Run Code Online (Sandbox Code Playgroud)

对此有什么帮助吗?

pdf node.js npm puppeteer

2
推荐指数
1
解决办法
5265
查看次数

标签 统计

node.js ×1

npm ×1

pdf ×1

puppeteer ×1