友情提示puppeteer最新版本不支持node最新版本

来源:10-5 爬虫代码实现1

calmound

2017-12-15

如题,最新版本下会报错

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Node is not visible
(node:6988) [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.

将packjon的puppeteer的版本换到老师的0.11.0版本就可以了

写回答

4回答

benliuss

2018-01-01

网页里的button元素不可见了,把 s_btn 换成 s_search就 可以。

2
0

慕后端8381663

2019-08-07

将await page.click('.s_btn');

改用:

await page.evaluate(()=>{

document.querySelector('.s_btn').click()

});

就能行了

0
0

慕侠0355299

2018-09-18

的确如此!


0
0

Samaritan

2017-12-15

puppeteer api 不稳定,关注一下最新的文档

0
0

Node.js入门到企业Web开发中的应用

Node.js是Web应用开发的一个福音,特别适合中小型系统的快速开发!

1580 学习 · 303 问题

查看课程