[英]python - pdfkit from url to PDF
I'm trying to convert Web Page to PDF using the code below. 我正在尝试使用下面的代码将网页转换为PDF。
import pdfkit
pdfkit.from_url(str(url), 'out.pdf')
But I need first to register to the web. 但我需要先注册网络。
How can I Add username and password as parameters in the Url?? 如何在Url中添加用户名和密码作为参数?
Best option is transmitting a cookie of a connected user to pdfkit. 最佳选择是将连接用户的cookie传输到pdfkit。
pdfkit.from_url(str(url), 'out.pdf', options={ cookie: 'cookiename cookievalue' })
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.