(3种解决思路)OSError: [Errno 22] Invalid argument:解决python爬虫中报错

虽然是个小问题,但是纠结我好长时间,找了就此记录一下。

1.路径问题

更改为:

with open('./file/hi.txt','r','encoding='utf-8'')

with open('.//file//hi.txt','r'

你可能感兴趣的:(爬虫,python)