I'm very new to Python, I'm trying to read json data from an API call. The problem is an error saying TypeError: <http.client.HTTPResponse object at 0x030CF310> is not JSON serializable
however the data I'm trying to pull from is the correct format, https://en.wikipedia.org/w/api.php?action=query&titles=Main%20Page&prop=revisions&rvprop=content&format=json . Here's the code I'm trying to run.
import urllib.request
import json
url = "https://en.wikipedia.org/w/api.php?action=query&titles=Main%20Page&prop=revisions&rvprop=content&format=json"
req = urllib.request.urlopen(url)
page = json.dumps(req)
print(page)