import os import shutil import requests def dl(urlx,namex): res = requests.get(urlx, stream=True) if res.status_code == 200: with open(namex, 'wb') as file: res.raw.decode_content = True shutil.copyfileobj(res.raw, file) for i in range(20): n=str(i+1) if i+1>9: n="0"+n if i+1<10: n="00"+n w="http://bishonen-av.com/imgs/products/btis085/l/"+n+".jpg" dl(w,"data/"+"慧"+n+".jpg")