zhentaoo/puppeteer-deep

centos 7 报错

Closed this issue · 5 comments

puppeteer-deep@1.0.0 es6 /home/visionet/puppeteer-deep-master
rm -rf ./es6-pdf/* && node es6-crawl.js

(node:21859) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to connect to chrome!
(node:21859) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

  1. node版本是多少? 如果切换node版本了,重新npm i一下
  2. 是改成使用 headless: false 了?

我改成这样不报这个错了

await puppeteer.launch({ args: ['--no-sandbox', '--disable-setuid-sandbox'] });
但是又报这个错了
Error: not opened
at WebSocket.send (/home/visionet/spa-seo/node_modules/ws/lib/WebSocket.js:355:18)
at Connection.send (/home/visionet/spa-seo/node_modules/puppeteer/lib/Connection.js:72:14)
at Browser.newPage (/home/visionet/spa-seo/node_modules/puppeteer/lib/Browser.js:44:47)
at app.use (/home/visionet/spa-seo/index.js:20:30)
at dispatch (/home/visionet/spa-seo/node_modules/koa-compose/index.js:42:32)
at /home/visionet/spa-seo/node_modules/koa-compose/index.js:34:12
at Server.handleRequest (/home/visionet/spa-seo/node_modules/koa/lib/application.js:136:14)
at emitTwo (events.js:125:13)
at Server.emit (events.js:213:7)
at parserOnIncoming (_http_server.js:602:12)

最简单的demo是:npm run zhentaoo
你的问题,我这边没有复现,现在有解决么?

解决了,我在服务器上手动装了chrome

👍