我正在尝试使用 snscrape 从 X 中提取最新的推文,但是此代码对我不起作用。 AttributeError:“FileFinder”对象没有属性“find_module”
import snscrape.modules.twitter as sntwitter
import pandas as pd
# Created a list to append all tweet attributes(data)
attributes_container = []
# Using TwitterSearchScraper to scrape data and append tweets to list
for i,tweet in enumerate(sntwitter.TwitterSearchScraper('from:john').get_items()):
if i>100:
break
attributes_container.append([tweet.date, tweet.likeCount, tweet.sourceLabel, tweet.content])
# Creating a dataframe from the tweets list above
tweets_df = pd.DataFrame(attributes_container, columns=["Date Created", "Number of Likes", "Source of Tweet", "Tweets"])
我收到的错误是这样的:
AttributeError: 'FileFinder' object has no attribute 'find_module'
该错误来自 snscrape 本身,仍然需要修复。有关更多信息,请参阅下文 - https://github.com/JustAnotherArchivist/snscrape/issues/782