微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Twitter Scraper,未显示结果

如何解决Twitter Scraper,未显示结果

我是一名学生,对采矿或抓取完全陌生,而且我的英语不太好。我想从特定日期获取“推文”。我是按照教程一步一步来的,但是最后没有显示结果。我正在使用 google colab 研究。

这是代码

Installing twitterscraper

!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

enter image description here

this is the final result I expected

这是我期待的最终结果

之前出现关于模块的错误无法找到但当我将编码文件保存在从教程站点下载的 twittercrapper 文件夹中时它已修复

任何帮助将不胜感激。谢谢

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。