python 爬虫,网页转PDF:OSError: No wkhtmltopdf executable found

时间:2018-06-02 10:47:24   收藏:0   阅读:1322

解决办法:

代码中设置参数:

path_wk = rD:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe #wkhtmltopdf安装位置

 config = pdfkit.configuration(wkhtmltopdf = path_wk)

最后执行转pdf操作

pdfkit.from_string("hello world","1.pdf",configuration=config)#字符转PDF

pdfkit.from_files("hello world","1.pdf",configuration=config)#网页转PDF

原文:https://www.cnblogs.com/qiu-hua/p/9124510.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!