Python Development Simple Crawler (ii)---Crawl Baidu wikipedia page data

Source: Internet
Author: User

First, the development of crawler steps

1. Determine the target crawl strategy:

Open the target page and use the right-click Review element to determine the URL format, data format, and page encoding of the Web page.

① first look at the format of the URL, F12 observe the form of the link;
② look at the target Text information label format, such as text data for div class= "xxx",
③ easy to see encoded as Utf-8


2. Analysis Objectives
Target: Baidu Encyclopedia Python entry
Entry page: Http://baike.baidu.com/item/Python
Entry page URL format:/item/****
Data format:
Title: <dd class= "Lemmawgt-lemmatitle-title" >

Introduction: <div class = "Lemma-summary" >****</div>
Page ID: utf-8

3. Instance Code

Crawl the Baidu Encyclopedia Python Entry and related 1000 page data

Python Development Simple Crawler (ii)---Crawl Baidu wikipedia page data

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.