m010k / baiduwenkuspider Goto Github PK
View Code? Open in Web Editor NEW实现对百度文库文档以pdf形式原格式下载
Home Page: https://github.com/M010K/BaiduWenkuSpider
实现对百度文库文档以pdf形式原格式下载
Home Page: https://github.com/M010K/BaiduWenkuSpider
我在运行GetAll.py的时候html转pdf那步pdfkit没加载,需在文件头加入import语句
大神您好,我把您的这个项目做了一点修改,改成了一个基于flask的python web项目,在这里和您说一下https://github.com/ChangeWeDer/BaiduWenkuSpider_flaskWeb
`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类型的时候,有的时候有问题
昨天还正常, 今天使用会报错TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
去看了下response, 里边有句话:
看网上有人说可能是被反爬了, 需要cookie
但是我把整个header都贴上了也不行...
大神您好,我把您的这个项目做了一点修改,改成了一个基于flask的python web项目,在这里和您说一下https://github.com/ChangeWeDer/BaiduWenkuSpider_flaskWeb
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.