Python Crawler---beautifulsoup (2)

Source: Internet
Author: User
Tags xml parser

Previously we were using Python's own parser, Html.parser. Official web side There are some other parsers, we learn from each other.

Parser How to use Advantages Disadvantages
Htm.parser BeautifulSoup (markup, ' Html.parser ')

1. Python comes with

2, the resolution speed is passable

3, fault-tolerant strong

2.7 Prior versions, and 3.3 not including 2.7 are not supported
lxml ' s HTML parser BeautifulSoup (markup, ' lxml ')

1, very fast

2, fault-tolerant strong

To install the C language Library
lxml ' s XML parser

BeautifulSoup (markup,[' lxml ', ' xml ')

BeautifulSoup (markup, ' XML ')

1. Fast speed

2. The only parser that supports XML

Need to install the C language Library
Html5lib BeautifulSoup (markup, ' Html5lib ')

1. The strongest fault tolerance

2. Parsing documents in Browser mode

3. Generate HTML5 Format documents

1. Slow speed

2, do not rely on external expansion

That's all you got to know.

  

Python Crawler---beautifulsoup (2)

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.