node-lessons icon indicating copy to clipboard operation
node-lessons copied to clipboard

关于爬虫,动态加载的页面,如何等待?

Open dayday89 opened this issue 9 years ago • 4 comments

得不到完整的sres.text

dayday89 avatar Nov 28 '14 03:11 dayday89

这个就要使用那种涉及 headless browser 的技术来抓页面了,superagent 抓了页面之后,js 是不执行的。

alsotang avatar Nov 28 '14 03:11 alsotang

看这里看这里

https://github.com/segmentio/nightmare

elrrrrrrr avatar Mar 17 '16 05:03 elrrrrrrr

@elrrrrrrr 就爬虫来说,我应该会用 phantomjs 先渲染页面,然后再静态地去捕获想要的字段。或者干脆直接偷它们 ajax api 来用。

alsotang avatar Mar 17 '16 15:03 alsotang

从页面分析动态数据接口,然后直接用起来,效果会更好,一般都是结构化的json数据,爽翻你!

yishuangxi avatar Apr 05 '16 04:04 yishuangxi