- 공공데이터포털의 목록 추출
- R 추출 코드
library(rvest)
# 웹문서 읽기
url <- "https://www.data.go.kr/tcs/dss/selectDataSetList.do"
html <- read_html(url)
html
# 목록 아이템 제목 추출
title <- html_nodes(html, "#apiDataList .title") |>
html_text()
title
# 목록 아이템 개요 추출
data_desc <- html_nodes(html, "#apiDataList .ellipsis") |>
html_text()
data_desc
# 데이터 정제
title_gsub <- gsub("\r|\n|\t", "", title)
title_gsub
desc_gsub <- gsub("\r|\n|\t", "", data_desc)
desc_gsub
# 데이터 출력
api_df <- data.frame(title=title_gsub, description=desc_gsub)
api_df

'워크시트' 카테고리의 다른 글
[Excel] VLOOKUP 함수 (0) | 2022.05.29 |
---|---|
[ADP] ADP 2과목 정리 (2) | 2022.05.22 |
[Excel] 엑셀에서 다른 시트, 다른 문서로 가는 링크 만들기 (0) | 2022.04.16 |
[Excel] 엑셀 중복 데이터 제거 (0) | 2022.03.20 |
[GA] 구글 데이터 스튜디오 (0) | 2022.03.03 |