Python:从URL下载返回的Zip文件 [英] Python: Download Returned Zip file from URL
本文介绍了Python:从URL下载返回的Zip文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我有一个URL,当在Web浏览器中提交时,弹出一个对话框来保存zip文件...我将如何在Python中捕获和下载此zip文件?
If I have a URL that, when submitted in a web browser, pops up a dialog box to save a zip file...how would I go about catching and downloading this zip file in Python?
谢谢!
推荐答案
使用 urllib2.urlopen
。返回值是一个类似文件的对象,您可以 read()
,传递给 zipfile
等等。
Use urllib2.urlopen
. The return value is a file-like object that you can read()
, pass to zipfile
and so on.
这篇关于Python:从URL下载返回的Zip文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文