在阿里云服务器上,系统是Debian8.9,安装puppeteer是使用cnpm i puppeteer的命令安装的,安装也成功了,在进行测试的时候出现了问题,我的测试代码如下:
const puppeteer = require(‘puppeteer’);
(async () => {
let browser = await puppeteer.launch({
executablePath: ‘./chromium/chrome.exe’,
headless: false
});
const page = await browser.newPage();
await page.goto(‘http://music.163.com/’);
await page.screenshot({path: ‘music.png’});
browser.close();
})();
运行后出现如下的错误:
(node:23748) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to launch chrome! spawn ./chromium/chrome.exe ENOENT
TROUBLESHOOTING: https://github.com/GoogleChro...
(node:23748) [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.
请问一下有没有碰到这样的,怎么样来解决呢???感谢!!!
江户川乱折腾
相关分类