Downloading multiple files with requests in Python
问题 Currently im facing following problem: I have 3 download links in a list. Only the last file in the list is downloaded completely. The others have a file size of one kilobyte. Code: from requests import get def download(url, filename): with open(filename, "wb") as file: response = get(url, stream=True) file.write(response.content) for link in f: url = link split_url = url.split("/") filename = split_url[-1] filename = filename.replace("\n", "") download(url,filename) The result looks like