【发布时间】:2017-06-12 06:01:59
【问题描述】:
我正在使用 tweepy API 来搜索推文。我的代码如下所示
num_tweets=10
search = 'tesla stock'
num = 0
for tweet in tweepy.Cursor(api.search,q=search+" -filter:retweets",count=num_tweets,lang="en").items():
num +=1
print(num)
print(tweet.text)
上面的代码不考虑 count 参数并一直运行,直到应用程序的请求速率限制达到以下错误
TweepError:Twitter 错误响应:状态码 = 429
我错过了什么吗?
以下是部分结果。看到结果数多了很多:
1
We have 100 of the Tesla adapters in stock:
2
@erikher101095 also PLEASE BUY TESLA STOCK!!
3
#Tesla $TSLA is the most exciting stock. but it’s not as 24/7 non-stop global exciting as crypto ???? #cryptotrifecta
....
1764
Love Tesla cars & stock, but $7500+ rebates fueled Tesla growth & Musk just kicked taxpayers firmly in the a**!
1765
Tesla's Model 3 could reverse its stock slide #ElonMusk #ElonMusk
1766
Tesla Inc (TSLA) Stock at Risk as Trump Exits Paris Accord
【问题讨论】: