采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
老师,这个爬取豆瓣的trailer-list,有时候可以正常爬到数据,但是大部分时候会提示这个错误问题
看错误是被豆瓣反弹了,可能次数或者频率触发了反爬机制,你可以连上手机 4G,把爬的内容个数设置小一些,试试看。
非常感谢!
加个请求发送的随机延时看看行不行,,反扒机制有可能是根据请求的间隔时间来判断是否是机器的。
下载了最新的node9 +的版本,发现这个问题迎刃而解了
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了一下, 报这个错误
puppeteer.launch({headless:false})
加上这条参数就可以获取到数据,可是这样每次都会弹出浏览器呀!
登录后可查看更多问答,登录/注册
Koa2+MongoDB+Parcel+Puppeteer+AntDesign快速搭建预告片网站
1.2k 7
1.3k 7
1.0k 6
848 6
971 6
购课补贴联系客服咨询优惠详情
慕课网APP您的移动学习伙伴
扫描二维码关注慕课网微信公众号