Java crawler One (analyze Web sites to crawl data)

Source: Internet
Author: User

First, get the address of the website you want to crawl:

http://www.zhaopin.com/

Then open the console, F12, open. I'm using chrome and I prefer Chrome's console fonts to people.

Find the corresponding HTML tag for the search bar:

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/06/09/wKiom1mwoZOz2lpoAAFE_PMYCpk055.png "title=" Capture. png "alt=" Wkiom1mwozoz2lpoaafe_pmycpk055.png "/>


650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/A4/BA/wKioL1mwocbxQFYtAADm9FsfanE581.png "title=" Capture. png "alt=" Wkiol1mwocbxqfytaadm9fsfane581.png "/>

Http://sou.zhaopin.com/jobs/searchresult.ashx?jl=%E6%B7%B1%E5%9C%B3&kw=Java&sm=0&p=1

You can also enter this URL directly in the address bar. And before entering the job box input Java, the region for Shenzhen is the same, before clicking on the "Search work" button also jump to this page.

The following column is the number of result bars for the search, which may be helpful for us to perform loops.

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/06/09/wKiom1mwpTqw8SFpAABbiYELm0I215.png "title=" Capture. png "alt=" Wkiom1mwptqw8sfpaabbiyelm0i215.png "/>


650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/A4/BB/wKioL1mwpzmADEiTAADZMu37Rgw934.png "title=" Capture. png "alt=" Wkiol1mwpzmadeitaadzmu37rgw934.png "/>


This is the HTML div block that locates all the recruitment information for a page:

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/A4/BB/wKioL1mwqSLwuNhFAAA4te4kSFQ678.png "title=" Capture. png "alt=" Wkiol1mwqslwunhfaaa4te4ksfq678.png "/>

So specific to a company's recruitment information:

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/A4/BB/wKioL1mwqYGh3K_GAAAnbOsXH9c583.png "title=" Capture. png "alt=" Wkiol1mwqygh3k_gaaanbosxh9c583.png "/>

This corresponds to this company:

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/A4/BB/wKioL1mwqc6zonXDAAAZNyflsIo972.png "title=" Capture. png "alt=" wkiol1mwqc6zonxdaaaznyflsio972.png "/> But what we need is specific information, so we expand the <table></table> < Tr></tr>:

All of the labels are expanded to look too long, and we see separately:

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/A4/BB/wKioL1mwrMXzKrAlAADfe35LXPQ995.png "title=" Capture. png "alt=" Wkiol1mwrmxzkralaadfe35lxpq995.png "/>

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/A4/BB/wKioL1mwrQLyke4tAAAMe18wgw0927.png "title=" Capture. png "alt=" wkiol1mwrqlyke4taaame18wgw0927.png "/> So there's another one we saw on the page: The drop-down arrow. Open the drop-down arrow will see the details, here in fact, the HTML of the page is already included, but the default is hidden.

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/06/0B/wKiom1mwrdni2L-DAADWrdKNn24235.png "title=" Capture the display results for. png "alt=" Wkiom1mwrdni2l-daadwrdknn24235.png "/>:

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/06/0B/wKiom1mwriqQQFYoAAAx8WVTstE507.png "title=" Capture. png "alt=" wkiom1mwriqqqfyoaaax8wvtste507.png "/> So what information I want to get, I won't get too much information. Here I only want to get the "job title", "Experience", "education", "salary" and so on. If you need to obtain job requirements and company address, you must click into the post to view.

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/06/0B/wKiom1mwr1qiynKWAACn8Si0dtQ877.png "title=" Capture. png "alt=" Wkiom1mwr1qiynkwaacn8si0dtq877.png "/>

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/06/0B/wKiom1mwr7nxmWDEAADTbJkz0hs725.png "title=" Capture. png "alt=" Wkiom1mwr7nxmwdeaadtbjkz0hs725.png "/>

Java crawler One (analyze Web sites to crawl data)

Related Article

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.