import{BrowserWindow,app}from"electron";importpiefrom"puppeteer-in-electron-x";importpuppeteerfrom"puppeteer-core";constmain=async()=>{awaitpie.initialize(app);constbrowser=awaitpie.connect(app,puppeteer);constwindow=newBrowserWindow();consturl="https://example.com/";awaitwindow.loadURL(url);constpa...
Use puppeteer to test and control your electron application. npm install puppeteer-in-electron puppeteer-core electron See the API documentation. JavaScript const {BrowserWindow, app} = require("electron"); const pie = require("puppeteer-in-electron") const puppeteer = require("puppeteer-core");...
npm 在安装 puppeteer 的时候可能会报错!这是由于外网导致,使用淘宝镜像 cnpm 安装可解决。 安装Puppeteer时,它将下载 Chromium 的最新版本。从1.7.0版开始,官方发布了该puppeteer-core软件包,默认情况下不会下载任何浏览器,用于启动现有的浏览器或连接到远程浏览器。需要注意安装的 puppeteer-core 版本与打算连接的浏...