Python Development Kit's recommended series of XML, HTML parser pyquery

Source: Internet
Author: User

Using Python, like her simplicity is on the one hand, but also it has a rich development package easy to use and convenient next will recommend a series of great development package.


In parsing the HTML, XML process, we have a lot of packages can be used. such as BS, lxml, xmltodict and so on if you want to get started immediately, then Pyquery must be the best choice.


As you can see from the name, she must have a certain relationship with jquery.

 

on the official website This is how it describes its

Pyquery:a Jquery-like Library for Python


Yes, the author has encapsulated the parsing interface of HTML and XML into a jquery-like approach.


> Let's see how it's applied.


Official website: http://pythonhosted.org/pyquery/#

Installation: Pip Install Pyquery


Let's start with an example.

Pyquery accepts multiple inputs: string, etree object, URL, and filename object, which is not the point, see the following

The attentive friend can see that we are not in the standard XML format in the input XML string, and the label does not match.


But the PQ can still be handled normally, for some people often want to crawl the page of friends simply ~ Great


Well, more ways you can see the document try http://pythonhosted.org/pyquery/#


Today's recommendation is here, the next period has more exciting development package recommendations


Welcome to the public, "life is too short for me to use Python."


Python SDK recommended series XML, HTML parser pyquery

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.