使用python的urllib库进行对应操作
一、下载网页
import urllib.request
url_page = 'http://www.baidu.com'
urllib.request.urlretrieve(url_page, 'baidu.html')
二、下载图片
import urllib.request
url_img = 'https://img0.baidu.com/it/u=2485402944,2364587673&fm=253&fmt=auto&app=138&f=JPEG?w=888&h=500'
urllib.request.urlretrieve(url_img, 'haizeiwang.jpg')
三、下载视频
import urllib.request
url_video = 'https://vd2.bdstatic.com/mda-mbnk58y0439eam7a/v1-hknm/sc/mda-mbnk58y0439eam7a.mp4?v_from_s=hkapp-haokan-hnb&auth_key=1678371901-0-0-e088effcf5acf6b45a62216a7c286321&bcevod_channel=searchbox_feed&pd=1&cd=0&pt=3&logid=3301042779&vid=9041017609575437420&abtest=107354_1-107353_1&klogid=3301042779'
urllib.request.urlretrieve(url_video, 'qinzi.mp4')