1. Website Introduction
You will often be redirected to an online tutorial as shown in the previous search for information:
01. Tutorial Styles
Some github projects include links to this site. After a search, the site is a Web site that can create, host, and browse documents at: https://readthedocs.org. A lot of good resources can be found on top.
Although the site provides download functionality, some tutorials do not provide PDF file downloads,
02. Download
This tutorial only provides the download of HTML format files, or is not very convenient to consult, so let us turn it into a PDF!
$ sudo apt-get install wkhtmltopdf # Ubuntu
$ sudo yum intsall wkhtmltopdf # CentOS
3.3 Getting chapter Content
Or the same way to locate the chapter content:
3.4 Save PDF
3.5 Merging PDFs
After the last step, all the chapters are saved in PDF, and finally we want to leave a PDF, we need to merge all the PDFs and delete the individual chapter PDF.
Originally PyPDF2 Library has a classPdfFileMergerspecifically used to merge PDFs, but in the merger process will throw an exception, online someone also encountered the same problem, the solution is to modify the library source code, the spirit of "Fixed library source code" concept, resolutely chose the above this relatively stupid method, the code is relatively good understanding.
After the above steps, we want the PDF file has been generated, together to enjoy the fruits of labor:
06. Saving Results
Welcome everyone to follow my blog: https://home.cnblogs.com/u/sm123456/Interactive Communication in the blog park
Welcome to join thousands of people to communicate questions and Answers group: 125240963
Crawl online tutorials with Python! and convert it to PDF for easy learning!