平均用时为第二个版本的0.5 - 2/3。
import requests
res = requests.get('http://lxml.de/lxmldoc-4.1.1.pdf', stream=True)
with open('./lxml.pdf', 'wb') as f:
for chunk in res.iter_content(chunk_size=10 * 1024 * 1024):
if chunk:
f.write(chunk)
网友评论