【Could not find Chrome This can occur if either】

爬虫练习中遇到的问题

使用puppeteer执行是提示一下错误

Error: Could not find Chrome (ver. 125.0.6422.78). This can occur if either

  1. you did not perform an installation before running the script (e.g. npx puppeteer browsers install chrome) or
  2. your cache path is incorrectly configured (which is: /**//.cache/puppeteer).

puppeteer这个库 需要chrome浏览器

要么安装,要么你电脑中浏览器的绝对路径放上

我电脑中的路径是这个
const CHROME_EXECUTALBE_PATH = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"

js 复制代码
  const browser = await puppeteer.launch({
        headless: false,
        defaultViewport: {
            width: 0,
            height: 0
        },
        executablePath: CHROME_EXECUTALBE_PATH // 这个路径写上就可以执行了
    });
相关推荐
还是鼠鼠38 分钟前
图书管理系统 Axios 源码 __删除图书功能
前端·javascript·vscode·ajax·前端框架·node.js·bootstrap
轻口味1 小时前
Vue.js `Suspense` 和异步组件加载
前端·javascript·vue.js
m0_zj2 小时前
8.[前端开发-CSS]Day08-图形-字体-字体图标-元素定位
前端·css
还是鼠鼠2 小时前
图书管理系统 Axios 源码__编辑图书
前端·javascript·vscode·ajax·前端框架
北极象2 小时前
vue3中el-input无法获得焦点的问题
前端·javascript·vue.js
百度网站快速收录3 小时前
网站快速收录:如何优化网站头部与底部信息?
前端·html·百度快速收录·网站快速收录
Loong_DQX3 小时前
【react+redux】 react使用redux相关内容
前端·react.js·前端框架
GISer_Jing3 小时前
react redux监测值的变化
前端·javascript·react.js
engchina3 小时前
CSS 样式化表格:从基础到高级技巧
前端·css
m0_528723813 小时前
react中useEffect的使用
前端·javascript·react.js