0

我使用 twint 包从 2016 年 1 月 1 日到 2021 年 1 月 1 日获取所有英文推文以搜索 btc,并将其保存为 csv 文件。我的代码如下所示(我使用的是 jupyter notebook)

import nest_asyncio
nest_asyncio.apply()
import twint

#configuration
config = twint.Config()
config.Search = "btc"
config.Lang = "en"
config.Since = '2016–01–01'
config.Until = '2021-01-01'
config.Store_csv = True
config.Output = "BTCtweet.csv"
#running search
twint.run.Search(config)

当我运行脚本时,出现以下错误: ValueError: time data '2016–01–01 00:00:00' does not match format '%Y-%m-%d %H:%M:%S'

我已经运行了没有Since和Until参数的脚本,它工作正常

4

1 回答 1

0

我有一个类似的问题。尝试删除并重新键入数字之间的连字符 (-)(如果您已复制/粘贴到 Jupyter Notebook 中)。它对我有用!

于 2021-08-29T17:04:21.750 回答