问题描述
您好,所以我使用以下代码通过tweepy挖掘推文
api_key = ""
api_secret = ""
consumer_token = ""
consumer_token_secret= ""
auth = tweepy.OAuthHandler(api_key,api_secret)
auth.set_access_token(consumer_token,consumer_token_secret)
api = tweepy.API(auth)
search_words = "new normal -filter:retweets"
date_since = "2020-06-30"
tweets = tweepy.Cursor(api.search,q=search_words,lang="id",since=date_since).items(1000)
with io.open('file.csv','w',newline='',encoding="utf-16") as file:
writer = csv.writer(file,quoting=csv.QUOTE_ALL)
writer.writerow(["Comment"])
for tweet in tweets:
writer.writerow([tweet.text])
我注意到,当结果用图像发送推文时,结果仅在推文的中间以“ ...”结束。例如
Bhabinkamtibmas desa Cipurwasari sambangi masyarakat dan berikan Himbauan Kamtibmas serta himbauan new normal pada… https://t.co/*********
New Normal masih bingung apa aja yang harus disiapkan? #sinokkemayu bantu kamu siapkan kebutuhan saat #newnormal ni… https://t.co/*********
有什么解决方法可以让我得到全文吗?
解决方法
将tweet_mode=extended
添加到您的API调用中。