반응형 dateframe1 [Web scraping] 멜론 TOP100 차트(2/2) 지난 시간에는 멜론 TOP 100 차트 페이지에서 1위부터 100위까지의곡명, 가수, 앨범, 발매일, 장르 등 상세 정보를 가져와 리스트화 까지 끝냈다. 오늘은 만들어낸 리스트를 JSON파일로 만들어서 아래의 작업을 해보려고 한다.1. json 파일을 load 하여 Pandas의 DataFrame에 저장하기2. DataFrame 객체를 DB의 Table에 저장하기 먼저 JSON 파일로 저장해보자 import json#with open(파일명,쓰기모드,인코딩) as file:with open('data/songs.json','w',encoding='utf-8') as file: json.dump(song_detail_list, file)EX) with open json.dump()import jsonwi.. 2022. 2. 9. 이전 1 다음 반응형