i\'m trying to open the URL of this API from the sunlight foundation and return the data from the page in json. this is the code Ive produced, minus the parenthesis around m
from urllib.request import urlopen from bs4 import BeautifulSoup wiki = "https://en.wikipedia.org/wiki/List_of_state_and_union_territory_capitals_in_India" page = urlopen(wiki) soup = BeautifulSoup(page, "html.parser" ).encode('UTF-8') print (soup)