If you want to extract structured data from Wikipedia, you may consider using DbPedia http://dbpedia.org/
It provides means to query data using given criteria using SPARQL and returns data from parsed Wikipedia infobox templates
There are some SPARQL libraries available for multiple platforms to make queries easier