问题描述
我是一名学生,对采矿或抓取完全陌生,而且我的英语不太好。我想从特定日期获取“推文”。我是按照教程一步一步来的,但是最后没有显示结果。我正在使用 google colab 研究。
这是代码
!pip install twitterscraper
import library,add keyword and date,etc
#Importing necessary files
from twitterscraper import query_tweets
import datetime as dt
import pandas as pd
#Providing the range of days in which I want the data
begin_date=dt.date(2020,12,1)
end_date=dt.date(2020,10)
#Providing limit to the fetched tweets and also specifying the language of the desired tweets
limit=10
language='english'enter code here
#Extracting tweets for the Keyword “Covid-19”
tweets=query_tweets("covid",limit=limit,begindate=begin_date,enddate=end_date,lang=language)'
`
Creating Dataframe for the extracted tweets
#Creating Dataframe for the extracted tweets
df=pd.DataFrame(t.__dict__ for t in tweets)
df.head()
结果应该在 'df.head()' 之后显示,但没有显示。而且也没有错误。那么为什么结果没有显示?.
我正在学习本网站的教程: https://codehacks.in/twitterscraper-scraping-twitter-data-with-python/
这是教程中的图片: enter image description here
this is the final result I expected
这是我期待的最终结果
之前出现关于模块的错误无法找到但当我将编码文件保存在从教程站点下载的 twittercrapper 文件夹中时它已修复
任何帮助将不胜感激。谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)