【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 // 这个路径写上就可以执行了
    });
相关推荐
昔人'2 分钟前
css`text-wrap:pretty`
前端·css
勇敢di牛牛8 分钟前
Vue+mockjs+Axios 案例实践
前端·javascript·vue.js
詩句☾⋆᭄南笙18 分钟前
HTML列表、表格和表单
服务器·前端·html·表格·列表·表单
IT_陈寒31 分钟前
Python性能翻倍的5个冷门技巧:从GIL逃逸到内存视图的实战优化指南
前端·人工智能·后端
南城巷陌35 分钟前
错误边界:用componentDidCatch筑起React崩溃防火墙
前端·react.js·前端框架
FinClip41 分钟前
OpenAI推出Apps SDK,你的企业App跟上了吗?
前端·app·openai
馨谙1 小时前
Linux中的管道与重定向:深入理解两者的本质区别
前端·chrome
夏天想1 小时前
复制了一个vue的项目然后再这个基础上修改。可是通过npm run dev运行之前的老项目,发现运行的竟然是拷贝后的项目。为什么会这样?
前端·vue.js·npm
@大迁世界1 小时前
这个 CSS 特性,可能终结样式冲突
前端·css
zzzsde1 小时前
【C++】深入理解string类(5)
java·前端·算法