【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 // 这个路径写上就可以执行了
    });
相关推荐
aiprtem2 分钟前
基于Flutter的web登录设计
前端·flutter
浪裡遊6 分钟前
React Hooks全面解析:从基础到高级的实用指南
开发语言·前端·javascript·react.js·node.js·ecmascript·php
why技术13 分钟前
Stack Overflow,轰然倒下!
前端·人工智能·后端
GISer_Jing18 分钟前
0704-0706上海,又聚上了
前端·新浪微博
止观止41 分钟前
深入探索 pnpm:高效磁盘利用与灵活的包管理解决方案
前端·pnpm·前端工程化·包管理器
whale fall42 分钟前
npm install安装的node_modules是什么
前端·npm·node.js
烛阴1 小时前
简单入门Python装饰器
前端·python
袁煦丞2 小时前
数据库设计神器DrawDB:cpolar内网穿透实验室第595个成功挑战
前端·程序员·远程工作
天天扭码2 小时前
从图片到语音:我是如何用两大模型API打造沉浸式英语学习工具的
前端·人工智能·github
鱼樱前端3 小时前
今天介绍下最新更新的Vite7
前端·vue.js