Python 3.x 尝试用python下载多个文件并报告是否成功
所以我正试图从一个网站上下载文件(包括图片和文档)。我必须把这些下载到一个特定的文件夹。到目前为止,我已经:Python 3.x 尝试用python下载多个文件并报告是否成功,python-3.x,Python 3.x,所以我正试图从一个网站上下载文件(包括图片和文档)。我必须把这些下载到一个特定的文件夹。到目前为止,我已经: images = re.findall("/([^/]+\.(?:jpg|gif|png))", html) output = open("output.txt","a+") output.write("\n" + f"[+] {len(images)} Images Found:" + "\n") for images in images: output.write(image
images = re.findall("/([^/]+\.(?:jpg|gif|png))", html)
output = open("output.txt","a+")
output.write("\n" + f"[+] {len(images)} Images Found:" + "\n")
for images in images:
output.write(images + "\n")
output.write("Beginning file download with urllib2..." + "\n")
imageurl = "images"
urllib.request.urlretrieve(url, "/downloads")
我如何保持文件名与特定文件类型的网站上的文件名相同
这只是处理图像的代码的一小部分。可能重复的