Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图片无法下载 #13

Open
alexkie007 opened this issue Apr 2, 2017 · 4 comments
Open

图片无法下载 #13

alexkie007 opened this issue Apr 2, 2017 · 4 comments

Comments

@alexkie007
Copy link

爬取我想要的代码时 对于网页里的所有图片 全部都是failed to load

@ghost
Copy link

ghost commented Apr 5, 2017

我还以为只有我一个人报这个错误哩,原来大家都有这个问题

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)
libpng warning: iCCP: extra compressed data==> ] 74%
libpng warning: iCCP: extra compressed data====> ] 77%
libpng warning: iCCP: extra compressed data====> ] 77%
libpng warning: iCCP: extra compressed data====> ] 77%
libpng warning: iCCP: extra compressed data====> ] 78%
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

@alexkie007
Copy link
Author

我对解决办法是 自己在代码里面加一段 获得图片真实地址后 下载图片到本地 生成pdf后删除图片

@xpguan
Copy link

xpguan commented Apr 21, 2017

怎么改的? 请赐教

@alexkie007
Copy link
Author

获得图片完整链接后将图片保存在本地 html里的路径都不用改 你按照相应路径保存即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants