It uses the BeautifulSoup library to extract the data from any webpage.
This code extract the data of countries, their capitals, contribution in world's population and its population from Wikipedia Page 1 and Page 2. It uses the table, tr and td tags in the HTML code to help extract all the data that are embedded in the web page and generates a JSON file of countries and their capitals.