我目前工作的环境:
- 视窗 10
- Python27
- wkhtmltoimage 0.12.4
- imgkit 模块
这是我的example.py
import os
import imgkit
imgkit.from_url('http://google.com', 'C:\out.jpg')
因为这段代码清楚地表明我正在尝试截取谷歌网站的截图。但是当我在 Windows 10 平台上运行这段代码时,我得到了这个错误。
INFO: Could not find files for the given pattern(s).
Traceback (most recent call last):
File "C:\testdns.py", line 3, in <module>
imgkit.from_url('http://google.com', 'C:\out.jpg')
File "C:\Python27\lib\site-packages\imgkit\api.py", line 32, in from_url
return rtn.to_img(output_path)
File "C:\Python27\lib\site-packages\imgkit\imgkit.py", line 240, in to_img
raise IOError('wkhtmltoimage reported an error:\n' + stderr)
IOError: wkhtmltoimage reported an error:
Loading page (1/2)
Rendering (2/2)
Error: Could not write to output file
Error: Could not save image
Done
Exit with code 1, due to unknown error.
现在我不知道如何进行