📜  使用python代码示例从链接下载pdf

📅  最后修改于: 2022-03-11 14:45:15.996000             🧑  作者: Mango

代码示例1
import urllib.request
pdf_path = ""
def download_file(download_url, filename):
    response = urllib.request.urlopen(download_url)    
    file = open(filename + ".pdf", 'wb')
    file.write(response.read())
    file.close()
 
download_file(pdf_path, "Test")