我正在尝试使用Python函数来下载zip文件
https://storage.googleapis.com/chrome-for-testing-public/122.0.6261.69/win32/chromedriver_win32.zip
我尝试了这个,文件已下载,但损坏不完整
import os
import requests
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36'}
url = 'https://storage.googleapis.com/chrome-for-testing-public/122.0.6261.69/win32/chromedriver_win32.zip'
request = requests.get(url, stream=True, headers=headers)
zip_filename = os.path.basename(url)
with open(zip_filename, 'wb') as zfile:
zfile.write(request.content)
googleapis.com 服务器已关闭,请稍候。