用python下载网页或图片

先安装requests

pip install requests

代码:
#引用 requests文件
import requests
#下载地址
Download_addres='http://xxxxxx/tel.htm'
#把下载地址发送给requests模块
f=requests.get(Download_addres)
#下载文件
with open("e:/12345.html","wb") as code:
     code.write(f.content)
 
 
--蔚州

posted on 2021-09-16 16:11  剩余价值  阅读(105)  评论(0编辑  收藏  举报

导航