python_scripts
python_scripts copied to clipboard
一些python相关的演示代码
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 "/usr/local/lib/python3.4/dist-packages/pdfkit/api.py", line 49, in from_file return r.to_pdf(output_path)...

 出现这种状况代表什么意思?
在执行转换pdf文件命令时总是报这个错,有人知道吗?查了一下都没有看到解决方法。
OSError: No wkhtmltopdf executable found: "b''" 那个报错 我环境变量里加的是 `D:\Program Files\wkhtmltopdf\bin\` 以为是\b这个在python里解析出错的造成的,于是去改成 `D:\\Program Files\\wkhtmltopdf\\bin\\` 还是不行。 我参考了老外的问答 http://stackoverflow.com/questions/27673870/cant-create-pdf-using-python-pdfkit-error-no-wkhtmltopdf-executable-found 改成 ``` config = pdfkit.configuration(wkhtmltopdf=r"D:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe") pdfkit.from_file(htmls, file_name, options=options, configuration=config) ``` 就可以正常运行了 请问只能这样处理吗?
明明已经有click了,一运行就报错
for card in cards: TypeError: 'NoneType' object is not iterable
创建PDF时出错
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 "/usr/local/lib/python3.5/dist-packages/pdfkit/api.py", line 49, in from_file return r.to_pdf(output_path)...
使用代理池,修复503.
错误信息:OSError: wkhtmltopdf exited with non-zero code 1. error: You need to specify at least one input file, and exactly one output file 请问,pdfkit是根据什么自动生成目录的?我修改代码后,生成的pdf文件没有生成目录