ulrlib_下载

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

import urllib_handler的基本使用.request
#下载网页
url_page='http://www.baidu.com'
#url代表下载路径,filename是文件名字
urllib.request.urlretrieve(url_page,"baidu.html")

#下载图片
url_imag='https://gips1.baidu.com/it/u=869589177,1848598878&fm=3028&app=3028&size=w931&q=75&n=0&f=PNG&fmt=auto&maxorilen2heic=2000000'
urllib.request.urlretrieve(url=url_imag,filename='image.jpg')

#下载视频
url_video='https://vdept3.bdstatic.com/mda-qgd2891c16cc1p35/360p/h264/1720920969149508765/mda-qgd2891c16cc1p35.mp4?v_from_s=hkapp-haokan-nanjing&auth_key=1720950217-0-0-c76b0b6fef675d36234a30b6db923966&bcevod_channel=searchbox_feed&pd=1&cr=0&cd=0&pt=3&logid=2617830577&vid=15798241631673631806&klogid=2617830577&abtest=101830_2-17451_1-3000225_1'
urllib.request.urlretrieve(url_video,"abc.mp4")


ulrlib_下载
https://ianwusb.blog/2024/07/26/ulrlib_下载/
作者
Ianwusb
发布于
2024年7月26日
许可协议