# 保存数据
with open('b站.csv', encoding='a+') as f:
f.write('{},{},{}\n'.format(author, title, arcurl))
Traceback (most recent call last):
File "D:/项目/Multi-Output-Neural-Tree-main/B站爬取健身视频/b站.py", line 15, in <module>
with open('b站.csv', encoding='a+') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'b站.csv'
b站.csv没有,要通过下面这个新建
with open('b站.csv', encoding='a+') as f:
# 保存数据
with open('b站.csv', 'a+') as f:
f.write('{},{},{}\n'.format(author, title, arcurl))
我用的是python 3.8;
我把encoding去掉之后就可以了,我也很无语;
所以在这里记录一下。
有无大佬可以在评论区指教一下,不胜感激。