借助:puppeteer-chromium-resolver,不用再安装puppeteer
npm install puppeteer-chromium-resolver --save
var puppeteerResolver = require("puppeteer-chromium-resolver");
var revisionInfo = await puppeteerResolver({
revision: "",
detectionPath: "",
folderName: '.chromium-browser-snapshots',
hosts: ["https://storage.googleapis.com", "https://npm.taobao.org/mirrors"],
retry: 3
});
console.log("Chromium revision installed and launchable is " + revisionInfo.launchable);
var browser = await revisionInfo.puppeteer.launch({
headless: true,
args: ['--no-sandbox'],
executablePath: revisionInfo.executablePath
}).catch(function (error) {
console.log(error);
});
var page = await browser.newPage();
await page.goto('https://www.google.com');
await browser.close();
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。