【发布时间】:2021-02-25 03:58:08
【问题描述】:
嘿,我正在尝试从 2020 年 10 月 1 日到今天发布推文,其中包含使用 tweepy 位于英国的“covid”关键字,并使用 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)
【问题讨论】:
标签: python-3.x twitter data-mining tweepy twitterapi-python