Tweepy 过滤器剂量不显示两个日期之间的所有结果



嘿,我正在尝试获取自2020年10月1日至今天一直在推特上发布的推文,其中包含"新冠肺炎"关键字,该关键字位于英国,使用tweety并使用pandas库将其导出为csv文件,但结果仅来自2020年10月份29日

这是代码的过滤部分

import sys
import tweepy as tw
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler , Stream
import json

access_token = "xxxxxx"
access_token_secret = "xxxx"
consumer_key = "xxxxx"
consumer_secret = "xxxxx"
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api = tw.API(auth, wait_on_rate_limit=True)
search_words ="covid"
date_since = "2020-10-01"
results = []
for tweet in tw.Cursor(api.search,tweet_mode='extended',q=search_words,lang="en",
since=date_since,geocode='51.745719,-1.236599,300km').items(9000):
results.append(tweet.created_at)

print(results)

默认情况下,Tweepy的搜索方法使用Twitter的传统标准搜索API,该API最多只能获取7天的Tweets历史记录。您需要使用30天搜索选项(API.search_30_day方法(,这也需要您在Twitter开发者门户中配置高级搜索环境。请注意,高级搜索的搜索运算符和语法与标准搜索中的不同。

最新更新