Python PDF解决方案的URL

Python PDF解决方案的URL,python,pdf,url,png,screenshot,Python,Pdf,Url,Png,Screenshot,如何将此URL传递到PDF? 我正在尝试下面的代码,但不起作用 我尝试了PNG的URL,或者一个页面的截图,但是没有用,只是生成了一个空的pdf/图像 有解决办法吗 网址: 代码: 输出: Loading pages (1/6) Warning: A finished ResourceObject received a loading progress signal. This might be an indication of an iframe taking too long to loa

如何将此URL传递到PDF? 我正在尝试下面的代码,但不起作用 我尝试了PNG的URL,或者一个页面的截图,但是没有用,只是生成了一个空的pdf/图像

有解决办法吗

网址:

代码:

输出:

Loading pages (1/6)
Warning: A finished ResourceObject received a loading progress signal. This might be an indication of an iframe taking too long to load.
Warning: A finished ResourceObject received a loading finished signal. This might be an indication of an iframe taking too long to load.
Counting pages (2/6)
Resolving links (4/6)                                                       
Loading headers and footers (5/6)                                           
Printing pages (6/6)
Done                                                                      
True

我发现的问题是网页有一个iframe,所以它看起来是空白的。。。如果你改变了这个url

然后它就会起作用。。。如果你有HTML/CSS的知识,检查一下谷歌浏览器控制台你会发现它,也许你应该考虑使用漂亮的汤

来获取iFrAMEF的内容。
import pdfkit

path_wkthmltopdf = r'C:\Program Files\wkhtmltopdf\bin\\wkhtmltopdf.exe'
config = pdfkit.configuration(wkhtmltopdf = path_wkthmltopdf)

#pdfkit.from_url("http://windte1910.acepta.com/v01/0EF57BFD40060E245941AE43E3F7DAB700A06338", "out2.pdf", configuration=config)
pdfkit.from_url("http://windte1910.acepta.com/ca4webv3/index.jsp?url=http://windte1910.acepta.com/v01/0EF57BFD40060E245941AE43E3F7DAB700A06338", "out2.pdf", configuration=config)

哪一个是你的SO?@GiovaniSalazar Windows 10I发现了一些…问题是web有一个iframe…例如,如果你用这个重新启用url,这项工作…@GiovaniSalazar谢谢,这项工作!!但在url中,请显示如下内容:%3A%2F%2F,是否有方法将其替换为://?我在下面回答了…您可以使用此链接进行解码/编码
import pdfkit

path_wkthmltopdf = r'C:\Program Files\wkhtmltopdf\bin\\wkhtmltopdf.exe'
config = pdfkit.configuration(wkhtmltopdf = path_wkthmltopdf)

#pdfkit.from_url("http://windte1910.acepta.com/v01/0EF57BFD40060E245941AE43E3F7DAB700A06338", "out2.pdf", configuration=config)
pdfkit.from_url("http://windte1910.acepta.com/ca4webv3/index.jsp?url=http://windte1910.acepta.com/v01/0EF57BFD40060E245941AE43E3F7DAB700A06338", "out2.pdf", configuration=config)