Skip to main content
 首页 » 编程设计

python之根据特定日期抓取推特数据

2025年05月04日8zfyouxi

我是 twitter Api 的新手,所以我不知道它在更广泛意义上的用途,实际上我正在 Ghaza 上抓取推文以进行分析,我抓取了它,但作为页面示例,这就是我所做的

while(page<=3): 
    tweets=api.GetSearch("#Egypt",per_page=100) 

现在我想抓取数据,但是从特定日期开始,比如我想抓取从 2010 年 2 月 2 日到 2012 年 3 月 7 日的数据。只要有线索就足够了,但我们不胜感激。

请您参考如下方法:

自 2014 年 2 月 1 日至 2014 年 2 月 5 日使用 [query] ( link to docs )

查询运算符

Operator                    Finds tweets… 
... 
superhero since:2015-07-19  containing “superhero” and sent since date “2015-07-19” (year-month-day). 
ftw until:2015-07-19        containing “ftw” and sent before the date “2015-07-19”. 
...