简体   繁体   English

使用python抓取流式推文和历史推文

[英]Crawl streaming tweets and historical tweets with python

I want to crawl streaming twitter data with python for a search query. 我想使用python抓取流式Twitter数据进行搜索查询。 One questions here: is it true that data I will collect is generated right from the time I run the script? 这里有一个问题:我将在运行脚本时立即生成要收集的数据吗?

Also, how to crawl tweets in the past given day? 此外,如何在过去一天抓取推文? Is is possible I can get access to all the tweets in that day? 那天我可以访问所有推文吗?

Thanks! 谢谢!

Yes it's true that if you do streaming it will be collected from the moment you start that service . 的,的确 ,如果您进行流式传输,它将在启动该服务的那一刻开始收集。

So what you can do is get old tweets by another mechanism, here is a github repo , it will give the result in CSV format and you can specify range of dates for that search too. 因此,您可以做的是通过另一种机制获取旧的推文 ,这是一个github repo ,它将以CSV格式给出结果,您也可以为该搜索指定日期范围。

And you can simultaneously run the streaming service which will provide you tweets from that point forward. 而且,您可以同时运行流服务,此服务将从那时起为您提供推文。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM