【问题标题】:Tweepy mining result just ends in the middle of the tweet with "..."Tweepy 挖掘结果只是在推文中间以“...”结尾
【发布时间】:2020-12-03 13:19:48
【问题描述】:

您好,我正在使用以下代码使用 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/*********

有什么办法可以让我得到全文吗?

【问题讨论】:

    标签: python twitter tweepy twitterapi-python


    【解决方案1】:

    tweet_mode=extended 添加到您的 API 调用中。

    【讨论】:

      猜你喜欢
      • 2015-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-22
      • 1970-01-01
      • 2013-04-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多