Created
May 11, 2017 20:54
-
-
Save fmasanori/7beb9dd4829844177cda5d529ab4c687 to your computer and use it in GitHub Desktop.
Species from Star Wars movies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
url = 'http://swapi.co/api/species/' | |
for d in range(1, 5): | |
d = '' if d == 1 else '?page='+str(d) | |
res = requests.get(url+str(d)) | |
res = json.loads(res.content.decode('utf-8')) | |
for specie in res['results']: | |
print (specie['name'], specie['classification'], | |
specie['language']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment