[问题] —headless

楼主: bchoice (choice)   2022-05-16 21:25:47
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)
作者: TheOneisNEO (Thomas Anderson)   2022-05-16 22:11:00
https://tinyurl.com/4msuapz2看起来用chrome/chromium是不行
作者: noworneverev (小朋友)   2022-05-17 00:49:00
换driver或试试weasyprintpdfkit也可以转

Links booklink

Contact Us: admin [ a t ] ucptt.com