I want to extract some text of Wikipedia as JSON, using SPARQL. The following query retrieves the text, but in HTML format. How can I get the JSON output?
# -*- coding: utf-8 -*-
from SPARQLWrapper import SPARQLWrapper, JSON
from pprint import pprint
sparqlwiki = SPARQLWrapper("https://en.wikipedia.org/wiki/Saket_Modi")
sparqlwiki.setReturnFormat(JSON)
resultswiki = sparqlwiki.query().convert()
from pprint import pprint
pprint(resultswiki)