Exploring PyQuery
PyQuery addresses DOM-based expressions or queries in a quick, easy, and effective manner. In this section, we will install PyQuery and explore a few of its important features so that we are ready to develop a web scraping script.
Important note
You can find plenty of Python libraries that are similar to PyQuery. A few examples are parsel
(https://pypi.org/project/parsel/), beautifulsoup
(https://pypi.org/project/beautifulsoup4/), selectolax
(https://pypi.org/project/selectolax/), and, of course, lxml
(https://pypi.org/project/lxml/).
Installing PyQuery
Please refer to the Technical requirements section before proceeding with installing the PyQuery library. With the help of the virtual environment (secondEd
) you created in Chapter 2, install or update PyQuery using pip
:

Figure 4.1: Installing PyQuery
As shown in Figure 4.1, installing PyQuery also installs or updates the lxml
and cssselect
libraries. To verify the installation...