We can make use of the requests Python module to download files. The requests module is a simple and easy-to-use HTTP library in Python that has various applications. Also, it helps establish the seamless interaction with the web services.
Downloading files
Getting ready
First of all, you have to install the requests library. This can be done using pip by typing the following command:
pip install requests
How to do it...
Let's try downloading a simple image file with the requests module. Open Python 2:
- As usual, import the requests library first:
>>>...