作者bchoice (choice)
看板Python
标题[问题] —headless
时间Mon May 16 21:25:47 2022
https://i.imgur.com/XfLozFR.jpg
各位高手,我的需求是将网页存成pdf,我有找到方法,但是他一定要用—headless的方法,才能存成功,如果把—headless拿掉就会跳以下错误,请问有解吗?我不想用无头的方式
selenium.common.exceptions.WebDriverException: Message: unknown error: unhandled inspector error: {"code":-32000,"message":"Printing is not available"}
(Session info: chrome=101.0.4951.64)
-----
Sent from JPTT on my iPhone
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 180.217.195.17 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1652707549.A.AB8.html
2F:→ TheOneisNEO: 看起来用chrome/chromium是不行 05/16 22:13
3F:→ noworneverev: 换driver或试试weasyprint 05/17 00:49
4F:→ noworneverev: pdfkit也可以转 05/17 00:51