import requests
import json

page = 1
category = ['약국', '우체국', '농협']
print("%-20s%-80s%-10s" % ('이름', '주소', '유형'))
datas = dict()
while 1:
    response = requests.get('https://8oi9s0nnth.apigw.ntruss.com/corona19-masks/v1/stores/json?page=%d&perPage=500' % page)
    maskdict = json.loads(response.text)
    if len(maskdict.get('storeInfos')) == 0:
        break
    for b in maskdict.get('storeInfos'):
        d=""
        if b.get('type') == '01':
            d=category[0]
        if b.get('type') == '02':
            d=category[1]
        if b.get('type') == '03':
            d=category[2]
        print("%-20s%-80s%-10s" % (b.get('name'), b.get('addr'), d))
    page = page + 1
