lzjun567 / python_scripts

一些python相关的演示代码
Apache License 2.0
716 stars 527 forks source link

后半部分的好多图片下载失败,是不是wkhtmltopdf分配的缓存太小了 #14

Open ghost opened 7 years ago

ghost commented 7 years ago

周半部分的好多图片下载失败,是不是wkhtmltopdf分配的缓存太小了。因为失败的图片总是后半部分的图。而错误信息也没有提示什么有用的: Traceback (most recent call last): File "crawler.py", line 165, in crawler.run() File "crawler.py", line 99, in run pdfkit.from_file(htmls, self.name + ".pdf", options=options) File "D:\Program Files\Python36\lib\site-packages\pdfkit\api.py", line 49, in from_file return r.to_pdf(output_path) File "D:\Program Files\Python36\lib\site-packages\pdfkit\pdfkit.py", line 156, in to_pdf raise IOError('wkhtmltopdf reported an error:\n' + stderr) OSError: wkhtmltopdf reported an error: Loading pages (1/6) Warning: Failed to load file:///static/img/404.png (ignore) Counting pages (2/6) Resolving links (4/6) Loading headers and footers (5/6) Printing pages (6/6) Done Exit with code 1 due to network error: ProtocolUnknownError