Accessing the WWW with Python
As we saw in the Why Python (for web scraping)? section, there are plenty of Python libraries for interacting with HTTP. requests
and urllib
are the two libraries that we are interested in using because of their in-depth features, various functions for dealing with HTTP communication, easy-to-read documentation, and popularity.
In order to start accessing the WWW with Python using these libraries, let’s verify that we have installed all of the required resources. In the following subsections, we will start setting things up, such as installing Python, creating a virtual environment, installing libraries in the created environment, and accessing the web using Python libraries.
Setting things up
It is assumed that the latest version of Python has been installed on your system. If not, please visit https://www.python.org/downloads/ for the latest version of Python for your OS. Regarding the general setup and installation procedure, please...