Webscraping Assignment


  1. Use the packages requests and beautifulsoup to get the text from the Wikipedia page on Energy in South Africa.

  2. Get only the information from the Overview table ‘Energy in South Africa’. Loop through the rows and columns of the table to get the data into a list. Turn the list into a pandas data frame with the table headings (as given in Wikipedia) as the column names.

  3. Plot energy production and export between 2004 and 2012 in a line graph. Remember to label your axes clearly and to provide a legend and title.

  4. Plot C02 emissions between 2004 and 2012. Remember to label your axes clearly and to provide a legend and title.


RAW CONTENT URL