【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 // 这个路径写上就可以执行了
    });
相关推荐
九酒10 小时前
AI Agent 开发踩坑记:口播功能非得用 APP 原生实现吗?
前端·人工智能·agent
Jackson__11 小时前
做了一段时间的AI coding后,我终于搞清了 CLI 和 MCP 的区别
前端·agent·ai编程
IT_陈寒13 小时前
JavaScript项目实战经验分享
前端·人工智能·后端
用户479492835691514 小时前
6w star,GitHub 趋势第一的 Ponytail,这个agent插件到底在火什么
前端·后端
薛定喵的谔15 小时前
我开源了一个精致的 Next.js 博客模板:Skyplume
前端·前端框架·next.js
张龙68716 小时前
构建生产级 AI Agent:工具调用与记忆架构实战指南
前端
kyriewen17 小时前
2026 年了,还在用 Node.js?Bun 迁移实战:20 分钟搞定,附踩坑记录
前端·javascript·node.js
青山Coding18 小时前
Cesium应用(八):物体运动的实现思路
前端·cesium
用户416596736935518 小时前
Android WebView 加载 file:// 离线页面调试教程
android·前端
Asmewill18 小时前
curl命令学习笔记一
前端