主要借助pdfkit库实现,而且需要下载wkhtmltopdf.exe,然后才能正常使用:
import pdfkit
wk_path = r'D:\wkhtmltopdf\bin\wkhtmltopdf.exe'
config = pdfkit.configuration(wkhtmltopdf=wk_path)
pdfkit.from_url(url, dest_path, configuration=config)
文件下载地址:可能需要翻墙
主要借助pdfkit库实现,而且需要下载wkhtmltopdf.exe,然后才能正常使用:
import pdfkit
wk_path = r'D:\wkhtmltopdf\bin\wkhtmltopdf.exe'
config = pdfkit.configuration(wkhtmltopdf=wk_path)
pdfkit.from_url(url, dest_path, configuration=config)
文件下载地址:可能需要翻墙