python下载文件

获取网页地址,下载到本地文件夹

import requests
import code
url = "http://data.5sing.kgimg.com/G140/M04/06/13/zA0DAFurVAuAdpq3AI0OnoTrpZU650.mp3";
print ("downloading with urllib")
r = requests.get(url)
with open("a.mp3","wb") as code:
    code.write(r.content)
print("download OK")
    

 

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
正在热议
更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务