运行爬虫文件一直出现如下错误:
Traceback (most recent call last):
File “D:/PyCharm1/workspace/AutoLogin/test/test1.py”, line 72, in
main()
File “D:/PyCharm1/workspace/AutoLogin/test/test1.py”, line 69, in main
find_Computer(URL,headers=headers)
File “D:/PyCharm1/workspace/AutoLogin/test/test1.py”, line 57, in find_Computer
write.writerow(row)
ValueError: I/O operation on closed file.
代码如下
问题是出现缩进错误,与for循环同级,即可解决
运行正常!!!