Python Twitter API:搜索30天
我试图为我的代码创建一个数据框,但当我运行它时,我只得到一个空的列/行Python Twitter API:搜索30天,python,twitter,twitterapi-python,Python,Twitter,Twitterapi Python,我试图为我的代码创建一个数据框,但当我运行它时,我只得到一个空的列/行 # This grabs the search of all specified tweets within 30 days choice = input("Enter the hashtag: ") tweets = tweepy.Cursor(api.search_30_day, environment_name = "AMC", query = choice).items(1
# This grabs the search of all specified tweets within 30 days
choice = input("Enter the hashtag: ")
tweets = tweepy.Cursor(api.search_30_day, environment_name = "AMC", query = choice).items(100)
j = 1
for tweet in tweets:
if tweet.lang == "en":
print(str(j) + ") " + tweet.text + "\n")
j = j + 1
# Create a dataframe with a column called Tweets FOR SEARCH_30_DAYS
df = pd.DataFrame( [tweet.full_text for tweet in tweets], columns = ["Tweets"])
df.head()