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...