Giter Club home page Giter Club logo

baiduwenkuspider's Issues

没有import pdfkit

我在运行GetAll.py的时候html转pdf那步pdfkit没加载,需在文件头加入import语句

GetAll使用报错

`Add MainContent Cost: 7.487329006195068s
-------------Start Convert--------------
Traceback (most recent call last):
File "/Users/sedationh/PycharmProjects/hard_python/baiduwenku/venv/lib/python3.7/site-packages/pdfkit/configuration.py", line 21, in init
with open(self.wkhtmltopdf) as f:
FileNotFoundError: [Errno 2] No such file or directory: b''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/sedationh/PycharmProjects/hard_python/baiduwenku/GetAll.py", line 666, in
"").Run()
File "/Users/sedationh/PycharmProjects/hard_python/baiduwenku/GetAll.py", line 627, in Run
self.convertHtmlToPdf()
File "/Users/sedationh/PycharmProjects/hard_python/baiduwenku/GetAll.py", line 598, in convertHtmlToPdf
pdfkit.from_file(os.path.join(self.htmlsdirpath, str(self.startpage) + self.htmlfile), savepath, options=options)
File "/Users/sedationh/PycharmProjects/hard_python/baiduwenku/venv/lib/python3.7/site-packages/pdfkit/api.py", line 47, in from_file
configuration=configuration, cover_first=cover_first)
File "/Users/sedationh/PycharmProjects/hard_python/baiduwenku/venv/lib/python3.7/site-packages/pdfkit/pdfkit.py", line 42, in init
self.configuration = (Configuration() if configuration is None
File "/Users/sedationh/PycharmProjects/hard_python/baiduwenku/venv/lib/python3.7/site-packages/pdfkit/configuration.py", line 27, in init
'https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf' % self.wkhtmltopdf)
OSError: No wkhtmltopdf executable found: "b''"
If this file exists please check that this process can read it. Otherwise please install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf

Process finished with exit code 1`

编码方式有问题

1、Getall第65行,建议增加utf-8编码方式,否则报错gbk无法解析某些字符。
2、判断是否为ppt类型的时候,有的时候有问题

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.