I am trying to retrieve all of the tweets matching a query between a start date and an end date. I am using the following code to store the tweets in a csv file:
for tweet in tweepy.Cursor(api.search, q=searchQuery, count=100, lang="en", since="2019-12-01", until="2020-04-07").items():
print(tweet.created_at, tweet.text)
csvWriter.writerow([tweet.created_at, tweet.text.encode('utf-8')])
tweetCountTest += 1
print(tweetCountTest)
It works fine if I set the end (until) date after 2020-05-05, but just exits the loop when I put any date before that. Is there something wrong with my code? Ideally, I want to be able to store all the tweets matching my query tweeted in any date range. Today is 2020-05-12