소스 검색

beautify fetching

package
flavis 4 년 전
부모
커밋
aac8280843
1개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. +6
    -3
      scraping/fetch.R

+ 6
- 3
scraping/fetch.R 파일 보기

@@ -16,9 +16,12 @@ download_protocol <- function(path, name) {
}

fetch_batch <- function(offset) {
url <- mk_url(offset)
res <- as.character(read_html(url))
paths <- str_match_all(res, "/resource/blob/.*?/([0-9]*-data\\.xml)")[[1]]
mk_url(offset) %>%
read_html() %>%
as.character() %>%
str_match_all("/resource/blob/.*?/([0-9]*-data\\.xml)") %>%
`[[`(1) ->
paths
mapply(download_protocol, paths[,1], paths[,2])
return(length(paths) > 0)
}


불러오는 중...
취소
저장