...or we can just use SPARQL and dbpedia!(http://wiki.dbpedia.org/) There are questions where you'll have to scrap more than one page to get an answer and things could get really complicated with shell commands.
dbpedia is a triple-store that allows us to perform simple queries against wikipedia data like listing music bands based on a particular city:
SELECT ?name ?place
WHERE {
?place rdfs:label "Denver"@en .
?band dbo:hometown ?place .
?band rdf:type dbo:Band .
?band rdfs:label ?name .
FILTER langMatches(lang(?name),'en')
}
or queries that involve multiple subjects, categories etc.