
We implemented the download method based on the idea presented in the post to download a file from a given URL. At the time of writing this post, it has 56 URLs in total but there are 19 separate images. The outcome is the list of the URLs of the interesting images which can be used in the download module. If you are interested in figuring out the source code, have a look at this commit add5d5f. Please read through the steps to set up and launch the project.

Let’s recall the demo project which was illustrated in the earlier post about parsing HTML document using XPath with lxml.

We take a closer look at the following snippet. That’s a kind of basic steps to download remote files on the internet. To use either of these modules, importing it and perform a call to the specific methods to establish a connection with the remote server, then hit the intended resources to download. The two formers are external modules you have to install before making use of them into your source code while the latter is a Python built-in module. As we said, there are some methods of downloading files from the internet by using one of these modules: requests, wget or urllib.
