siznax / wptools

Wikipedia tools (for Humans): easily extract data from Wikipedia, Wikidata, and other MediaWikis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

infobox exists but can't get that

ohoroyoi opened this issue · comments


there definitely exists infobox.

https://stackoverflow.com/a/10180899/10194999

commented

Thanks for trying wptools, @ohoroyoi!

You are correct. I appreciate the highlighted screen grab. The infobox is in the data attribute of your air_test result. You can access it with air_test.data['infobox'].

>>> pprint(air_test.data['infobox'])
{'IATA': 'AH',
 'ICAO': 'DAH',
 'airline': u'Air Alg\xe9rie',
 'callsign': 'AIR ALGERIE',
 'company_slogan': "''Always caring for you''",
 'destinations': '69',
 'fleet_size': '60',
 'focus_cities': u'[[Oran Es S\xe9nia Airport]]',
 'founded': '{{Start date|1947|3|15|df|=|y}}',
 'frequent_flyer': u'Air Alg\xe9rie Plus',
 'headquarters': '[[Algiers]], [[Algeria]]',
 'hubs': '[[Houari Boumediene Airport]]',
 'image': u'Logo Air Alg\xe9rie.svg',
 'image_size': '250px',
 'key_people': 'Bakhouche Alleche&nbsp;<small>([[CEO]])</small>',
 'num_employees': '9,078 (2010)',
 'parent': '[[Government of Algeria]]',
 'subsidiaries': u'{{Collapsible list\n|framestyle|=|border:none; padding:0;\n|title|=|<small>Subsidiaries List</small>\n|1|=|Air Alg\xe9rie Cargo\n|2|=|Air Alg\xe9rie Catering\n|3|=|Air Alg\xe9rie Technics\n|4|=|Air Alg\xe9rie Handling\n|5|=|Tour Operator}}',
 'website': '{{URL|www.airalgerie.dz/en/}}'}

There are more examples on the wiki.

Hope that helps!