码迷,mamicode.com
首页 > 编程语言 > 详细

python OSError: [Errno 22] Invalid argument: 'D:\\crawle\x01.html1'

时间:2017-09-29 23:03:47      阅读:452      评论:0      收藏:0      [点我收藏+]

标签:ges   argument   imp   data   int   err   www   python   alt   

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'

标签:ges   argument   imp   data   int   err   www   python   alt   

原文地址:http://www.cnblogs.com/chenligeng/p/7612831.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!