Created
May 5, 2019 16:00
-
-
Save mauforonda/ff236cd408844ee63a1befdf4483fcc4 to your computer and use it in GitHub Desktop.
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, json, os | |
def download(city): | |
with open("agbc/" + city.replace(" ", "_")+".json", "w") as f: | |
json.dump(requests.get("https://www.oopp.gob.bo/ajax/ecobolCorrespondenciaPorNombreDepartamento/" + city).json(), f, ensure_ascii=False, indent=2) | |
os.mkdir("agbc") | |
[download(city) for city in ["COCHABAMBA", "LA PAZ", "ORURO", "POTOSI", "SANTA CRUZ", "SUCRE"]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment