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