1.安装
下载淘宝镜像的,可以同时下载puppeteer和chromium下面两条语句即可

npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm i puppeteer

然后设置软连接。
2.

        const pathToExtension = "/data/chenxiangan/webuiproject/node_modules/puppeteer/node_modules/_puppeteer@1.19.0@puppeteer/.local-chromium/linux-674921/chrome-linux/chrome";  下载好的chrome路径
        const browser = await puppeteer.launch({
            executablePath: pathToExtension,
            headless: true,  //设置为无头模式
            args: ['--no-sandbox', '--disable-setuid-sandbox','--proxy-server=112.65.52.237:5672'] //这个是必须
        });

相关文章:

  • 2022-12-23
  • 2021-12-21
  • 2021-05-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-08
  • 2022-12-23
  • 2021-10-22
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案