Пример #1
0
def migComplex():
    print("Function migComplex")
    #지금 소스보니 문제가 있는듯
    tupSmallArea = REP_DAO.SELECT_RET_SMALL_AREA_CD2tup()
    for SmallArea in tupSmallArea:
        url = URL.getJsonKBRealEstatePastPriceInquery(
            'S', '01', '', '', REP_COM.tuple2Str(SmallArea), '', '', '', '',
            '', '')
        print(url)
        html = get_html(url)
        soup = BeautifulSoup(html, 'html.parser')
        l = str(soup)
        jSonSmallArea = json.loads(l)
        for smallRegn in jSonSmallArea['msg']['servicedata']['ARRAY수4']:
            print(smallRegn['물건식별자'], smallRegn['아파트명'], smallRegn['X좌표값'],
                  smallRegn['Y좌표값'])
            dicRetComplex = {
                'CMPX_IDF_ID': smallRegn['물건식별자'],
                'CMPX_IDF_NM': smallRegn['아파트명'],
                'KB_REGN_CD': REP_COM.tuple2Str(SmallArea),
                'X_COOR_VAL': smallRegn['X좌표값'],
                'Y_COOR_VAL': smallRegn['Y좌표값']
            }
            REP_DAO.INSERT_KMIG_KB_CMPX(dicRetComplex)
        time.sleep(sleeptime)
Пример #2
0
def migRetSmallAreaCode():
    print("Function migRetSmallAreaCode")
    tupMidArea = REP_DAO.SELECT_RET_MID_AREA_CD2tup()
    for MidArea in tupMidArea:
        url = URL.getJsonKBRealEstatePastPriceInquery(
            'S', '01', '', REP_COM.tuple2Str(MidArea), '', '', '', '', '', '',
            '')
        html = get_html(url)
        soup = BeautifulSoup(html, 'html.parser')
        l = str(soup)
        jSonMidArea = json.loads(l)
        for midRegn in jSonMidArea['msg']['servicedata']['소지역목록ARRAY']:
            print(midRegn['부동산소지역코드'], midRegn['부동산소지역명'])
            dicRetSmallArea = {
                'KB_REGN_CD': midRegn['부동산소지역코드'],
                'KB_REGN_NM': midRegn['부동산소지역명'],
                'UP_KB_REGN_CD': REP_COM.tuple2Str(MidArea)
            }
            REP_DAO.INSERT_KMIG_KB_SMALL_REGN(dicRetSmallArea)
        time.sleep(sleeptime)
Пример #3
0
def migComplexTyp():
    print("Function migComplexTyp")
    dicComplex = REP_DAO.SELECT_RET_CMPX_CD2dic()
    for Complex in dicComplex:
        url = URL.getJsonKBRealEstatePastPriceInquery(
            'S', '01', '', '', Complex['SMALL_KB_REGN_CD'],
            Complex['CMPX_IDF_ID'], '', '', '', '', '')
        print(url)
        html = get_html(url)
        soup = BeautifulSoup(html, 'html.parser')
        l = str(soup)
        jSon = json.loads(l)
        for sJSon in jSon['msg']['servicedata']['ARRAY수5']:
            print(sJSon['주택형일련번호'], sJSon['주택형'])
            dicRetComplex = {
                'CMPX_IDF_ID': Complex['CMPX_IDF_ID'],
                'HOUSE_TYP_SEQ': sJSon['주택형일련번호'],
                'HOUSE_TYP_NM': sJSon['주택형']
            }
            REP_DAO.INSERT_KMIG_KB_CMPX_TYP(dicRetComplex)
        time.sleep(sleeptime)