python使用requests下载数据

        # 下载和保存图像
        import requests
        video_url = '*****'
        response = requests.get(url=video_url)  # 下载视频到本地1.mp4
        video_bytes = response.content
        temp_video_path = '1.mp4'
        with open(temp_video_path, 'wb') as f:
            f.write(video_bytes)

 

posted @ 2021-07-01 15:41  牛郎  阅读(408)  评论(0编辑  收藏  举报