puppeteer

来源:6-2 利用 puppeteer 爬取和分析电影列表

BBAQ

2018-03-31

http://img.mukewang.com/szimg/5abf2ad20001583307260136.jpg

老师,这个爬取豆瓣的trailer-list,有时候可以正常爬到数据,但是大部分时候会提示这个错误问题

写回答

5回答

Scott

2018-04-01

看错误是被豆瓣反弹了,可能次数或者频率触发了反爬机制,你可以连上手机 4G,把爬的内容个数设置小一些,试试看。

1
1
BBAQ
非常感谢!
2018-04-04
共1条回复

testname

2018-04-01

加个请求发送的随机延时看看行不行,,反扒机制有可能是根据请求的间隔时间来判断是否是机器的。

2
0

BBAQ

提问者

2018-04-04

下载了最新的node9 +的版本,发现这个问题迎刃而解了

0
0

BBAQ

提问者

2018-03-31

Error: Navigation Timeout Exceeded: 30000ms exceeded
    at Promise.then (D:\job\doban\6-2\douban-trailer-imooc\node_modules\puppetee
r\lib\NavigatorWatcher.js:69:21)
    at <anonymous>
(node:10228) UnhandledPromiseRejectionWarning: Unhandled promise rejection (reje
ction id: 1): AssertionError [ERR_ASSERTION]: No node found for selector: .more
(node:10228) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate th
e Node.js process with a non-zero exit code.

try了一下, 报这个错误

0
0

BBAQ

提问者

2018-03-31

puppeteer.launch({headless:false})

加上这条参数就可以获取到数据,可是这样每次都会弹出浏览器呀!

0
0

Koa2框架从0开始构建预告片网站

Koa2+MongoDB+Parcel+Puppeteer+AntDesign快速搭建预告片网站

751 学习 · 362 问题

查看课程