What is Pyquerywhen we use crawlers to crawl Web pages, we also need to process the crawled HTML content to get the information we need. Pyquery is a python implementation of jquery that can be used to parse HTML content. installationmy environment: Ubuntu 14.04+python2.7command: Pip install pyqueryUseLoading HTML contentFrom pyquery import pyquery as PQHTML content can be loaded from a string, file, or URL
From pyquery import pyquery as Pqdoc_1 = PQ ("
get elements based on HTML tags From pyquery import pyquery as Pqdoc_1 = PQ ("
get HTML blocks or blocks of textuse HTML () and text ()From pyquery import pyquery as Pqdoc_1 = PQ ("
getting elements from an indexEQ (index) From pyquery import pyquery as Pqdoc_1 = PQ ("
get elements based on class name and IDFrom pyquery import pyquery as Pqdoc_1 = PQ ("
Get property valueFrom pyquery import pyquery as Pqdoc_1 = PQ ("
modifying property valuesFrom pyquery import pyquery as Pqdoc_1 = PQ ("
Find nested elements find ()From pyquery import pyquery as Pqdoc_1 = PQ ("
Get child elementsFrom pyquery import pyquery as Pqdoc_1 = PQ ("
Get parent ElementFrom pyquery import pyquery as Pqdoc_1 = PQ ("
To add a class to an elementFrom pyquery import pyquery as Pqdoc_1 = PQ ("
Determines whether the element has a given classFrom pyquery import pyquery as Pqdoc_1 = PQ ("
Python's Pyquery Usage summary