Home  >  Article  >  Web Front-end  >  怎么爬取twitter某个用户的所有tweets?

怎么爬取twitter某个用户的所有tweets?

WBOY
WBOYOriginal
2016-06-07 08:44:295210browse

目前有两个方法:
1. 直接调用twitter的API,读取一个特定用户的tweets,但是API的参数只有关于返回条数的限制,并没有偏移量参数。也就意味着,总是只能返回“最近的”n条tweets,而不能爬取所有的tweets。
2. 用HTTP请求模拟用户在浏览器上访问的行为,可以读取最近20条的tweets,但不知道该怎样发送HTTP请求才能模拟用户下拉这个操作来加载更早的tweets。

回复内容:

dev.twitter.com/docs/ap

有大路不走你偏要挖地道。


至于说API没什么参数啥的,麻烦仔细看文档。 实际在浏览器中操作一下下拉加载,用抓包软件抓包分析HTTP请求的参数 追踪对方网站的上拉ajax事件请求,然后根据ajax请求规律试试,或者模拟上拉动作,用jq的trigger
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn