CSDN Bowen Downloader (JAVA)

Source: Internet
Author: User

Own Java-made CSDN blog downloader, provide jar package and source code.

Source code is also open, anyway jar anti-compilation can also get the source code, novice will not jar encryption.


Resources CSDN in the audit bar ... It's slow.


Considering the class time to see the blog inconvenient, want to put all the good blog download down, on the phone to see.

A variety of Baidu, found a few tools.

1.http://blog.csdn.net/gzshun/article/details/7555525

The great God wrote ideas and tutorials, using his tools to discover the problems:

(1) Download is not complete, the test can only download the first page of the 21 article about.

(2) Generated PDF looks OK, the code part of the page beyond the scope of the PDF, resulting in invisible, inconvenient

2.http://www.cr173.com/soft/48129.html

The great God wrote the General Blog Export Tool, as if the interface has changed, invalid, export not.


I'm just thinking about writing a program.

Well, with the idea of http://blog.csdn.net/gzshun/article/category/932960 predecessors.

Expanded a bit, own the idea:

(1) Computer version changed to mobile version

Personal feeling mobile version csdn more streamlined, processing it is certainly convenient, link is http://m.blog.csdn.net/blog, the user name is the user's blog, here to distinguish between the user name and custom domain name, the computer version of the blog link is generally a custom domain name, For example: My Computer version csdn blog custom domain name is: Noaboutfengyue, my user name is: oWuGuanFengYue123, the computer version of http://blog.csdn.net/Plus both can jump to the blog, but in the mobile version can only access Http://m.blog.csdn.net/blog/oWuGuanFengYue123 Open the blog.

For ease of use, the program just read into the custom domain name can be downloaded, so, add a method, the function is to get the user name through the domain name, the implementation is very simple, open Http://blog.csdn.net/noaboutfengyue, The source code has the oWuGuanFengYue123 user name, through the regular expression parsing is ok.

(2) using Itext to produce PDF from HTML

Already stated in the http://blog.csdn.net/noaboutfengyue/article/details/45174787

(3) Get a list of all articles

Test found http://m.blog.csdn.net/blog/oWuGuanFengYue123?page= This page is the article page, when this number is large, larger than the article page, take a limit, 99999,http:// m.blog.csdn.net/blog/owuguanfengyue123?page=999999, it shows all the articles.

(4) The acquisition of the article list and the analysis of the article content

The page obtained in (3), through regular expression, parse out all the article title and URL, and then through this URL to get HTML source code, due to the use of itext, the format of the HTML source code is very strict, so here to Preprocess (here is a bit imperfect), such as <br> Error, must be changed to <br/>, and some, and then directly converted to PDF output.

(5) Add serial number

In order for the generated PDF to be ordered, it is numbered according to the author's first post. The generated file name is 1. title. pdf


Thinking about this, the details of some to deal with.

Instructions for use:

Download directory in the current program directory/csdn/user name


Show me.

With http://m.blog.csdn.net/blog/lmj623565791 This teacher's demonstration, the blog writes very well.



The processing process shows:


There are still some places that are not well handled and are generally well handled and can generate most PDFs.

Results:


That's it, Haha, the world is pure.

Do not say, I went to download a good blog to go to the class to see.


Copy to Google TranslateTranslation Results

CSDN Bowen Downloader (JAVA)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.