gallenqiu / -book118- Goto Github PK
View Code? Open in Web Editor NEW爬取文档投稿赚钱网、原创力文档(book118)的pdf、word文档并生成pdf文件,方便下载。
爬取文档投稿赚钱网、原创力文档(book118)的pdf、word文档并生成pdf文件,方便下载。
您好,我下载了一个100多页的文档,生成的PDF顺序错乱,基本上是下面的排序:
图片页码数:
1,
10,100,101,102,103,...,109,
11,110,111,112,113,...,119,
12,120,121,122,
13,14,15,...,19,
2,
20,21,22,23,...,29,
3,
30,31,32,33,...,39,
4,
40,41,42,43,...,49,
您可以说一下在哪里修改吗?
是同一目录下的意思 ?
比如下载的资料名为:Python教程,则生成的图片文件名为:Python教程1.png,Python教程2.png.......
但生成PDF时,实际顺序是:Python教程1.png,Python教程10.png,Python教程11.png,Python教程12.png,修改也很简单把
run.py中 with open('图片//'+str(self.title).split('.')[0]+str(c)+'.png','wb+')as f:
改为 with open('图片//'+str(self.title).split('.')[0]+str(c).zfill(n)+'.png','wb+')as f:
其中n就是根据总网址数量前加1个或两个0,生成Python教程01.png或者Python教程001.png就可以了
请教一下,我自己写book118的爬虫以作者思路可能不一样,我不知道为什么我抓包抓的getPreview包只能加载到预读部分,但是这个好像可以一次性全部爬取
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.