02_ use WebMagic to get CSDN referral expert's personal blog information

Source: Internet
Author: User

"First, take a look at CSDN's recommended experts page"

"And then look at the main page."

Ready to use crawlers to get a few variables

1. Name

2. Number of Visits

3. Points

4. Level

5. Ranking

6. Original

7. Reprint

8. Translation

9. Comments

10. Links

11. Photos

"Project" because the main use of webmagic, all the jar package at webmagic git address, download it by itself.

"User.java" is easy to display, or later stored in the database

 Packagecom.cnblogs.test; Public classUser {PrivateStringname;//name    PrivateStringFangwen;//Number of visits    PrivateStringJifen;//points    PrivateStringDengji;//level    PrivateStringpaiming;//ranking    PrivateStringYuanchuang;//Original    PrivateStringZhuanzai;//reproduced    PrivateStringYiwen;//translation    PrivateStringPinglun;//Reviews    PrivateStringLink;//links    PrivateStringPhoto;//Photos@Override PublicString toString () {return   "\n========================= \ n" + "name =" + name  + "\ n traffic =" + fangwen  + "\ n integrals =" + jifen  + "\ n level =" + dengji  + "\ n rank =" + paiming  + "\ n original =" + yuanchuang  + "\ n reprint =" + " Span style= "color: #ff0000;" >zhuanzai  + \ n = "+ yiwen  +" \ n Comment = "+ pinglun  + \ n link = "+ link  +" \ n photo = "+ photo  + "\n==========================\n" ; }
/******* omit Get/set method ******/}

"Csdnspider.java"

02_ use WebMagic to get CSDN referral expert's personal blog information

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.