2006年07月24日 星期一 08:05
Neil,您好!
我看到很多人在写类似的东西,PYTHON里面有没有一个模块来做这个?
在 2006-07-19 02:38:00 您写道:
>我今天用 python 写了一个网页抓取程序,现在发现 https 协议的网页不能够用 urllib.urlopen()
>函数获取(报错)。并且我搜索资料也没有找到办法。请指教!
>这是我的代码:
>
># 下载某一项资源
>def download_resource(src, src_type):
> url = get_resource_url(src)
> usock = urllib.urlopen(url)
> data = usock.read()
> usock.close()
> # save the file
> fname = sys.path[0] + '\\' + get_new_link(src, src_type).replace('/', '\\')
> fsock = file(fname, 'w')
> fsock.write(data)
> fsock.close()
>_______________________________________________
>python-chinese
>Post: send python-chinese at lists.python.cn
>Subscribe: send subscribe to python-chinese-request at lists.python.cn
>Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn
>Detail Info: http://python.cn/mailman/listinfo/python-chinese
致
礼!
cry
zyqmail at tom.com
Zeuux © 2025
京ICP备05028076号