Failed to launch the browser process! undefinedy以及Failed to load Chrome DLL from puppeteer错误的处理

如果您是在早期的windows机器上运行puppeteer,然后看到如下错误:

C:\XXXX\run-crawler\mfy-crawler-article-server\server-js\node_modules\@puppeteer\browsers\lib\cjs\launch.js:267
                reject(new Error([
                       ^
Error: Failed to launch the browser process! undefined
[0106/185822.796:ERROR:main_dll_loader_win.cc(112)] Failed to load Chrome DLL from C:\Users\Administrator\.cache\puppeteer\chrome\win64-119.0.6045.105\chrome-win64\chrome.dll:  

很有可能是因为你的puppeteer版本过高,对应chromium无法在该windows机器版本上运行,您可以试一下自己机器所能支持的chrome最高版本,然后查看与之对应的puppeteer最高版本,可以通过这个文件链接来查阅,其文件内容就是声明了该版本的puppeteer所应该使用的chromium的最高版本:

export const PUPPETEER_REVISIONS = Object.freeze({
  chromium: '1083080',
  firefox: 'latest',
});

你只需要通过这里改变puppeteer的版本,就能够看到对应的chromium版本号:

Failed to launch the browser process! undefinedy以及Failed to load Chrome DLL from puppeteer错误的处理_第1张图片

你可能感兴趣的:(网络爬虫,chrome,前端,puppeteer,网络爬虫)