import urllib.request
file = urllib.request.open(“http://www.baidu.com”)
data = file.read()
print(data)
fhandle = open(“D:\crawle\html1″,”wb”)
fhandle.write(data)
fhandle.close()
![python OSError: [Errno 22] Invalid argument: 'D:\\crawle\x01.html1' python OSError: [Errno 22] Invalid argument: 'D:\\crawle\x01.html1'](http://code.bmoook.com/wp-content/uploads/2023/03/20230307190509-64078ae5c9bdf.png)
然而在这时我运行时出错了
只需如下添加即可
![python OSError: [Errno 22] Invalid argument: 'D:\\crawle\x01.html1' python OSError: [Errno 22] Invalid argument: 'D:\\crawle\x01.html1'](http://code.bmoook.com/wp-content/uploads/2023/03/20230307190509-64078ae5d4a22.png)
import urllib.request
file = urllib.request.open(“http://www.baidu.com”)
data = file.read()
print(data)
fhandle = open(“D:\crawle\html1″,”wb”)
fhandle.write(data)
fhandle.close()
![python OSError: [Errno 22] Invalid argument: 'D:\\crawle\x01.html1' python OSError: [Errno 22] Invalid argument: 'D:\\crawle\x01.html1'](http://code.bmoook.com/wp-content/uploads/2023/03/20230307190509-64078ae5c9bdf.png)
然而在这时我运行时出错了
只需如下添加即可
![python OSError: [Errno 22] Invalid argument: 'D:\\crawle\x01.html1' python OSError: [Errno 22] Invalid argument: 'D:\\crawle\x01.html1'](http://code.bmoook.com/wp-content/uploads/2023/03/20230307190509-64078ae5d4a22.png)