library(stringr)
## Warning: package 'stringr' was built under R version 3.4.4
library(xml2)
## Warning: package 'xml2' was built under R version 3.4.4
library(purrr)
## Warning: package 'purrr' was built under R version 3.4.4
temp_list = vector("list", 42) #42개 list 설정
t1 <- Sys.time()
#페이지 for문이 안 먹힘 (추후 확인)
for(pageNum in 0:1) {
url = paste0('https://onlinelibrary.wiley.com/action/doSearch?AllField=network&startPage=', pageNum)
temp_html <- read_html(url)
temp_title <- xml_find_all(temp_html, xpath = ".//span[@class='hlFld-Title']") %>% xml_text()
temp_title <- temp_title %>% str_remove_all(., "\\\n") %>% str_trim() %>% str_squish()
temp_list[[pageNum+1L]] <- temp_title
}
my_title <- flatten(temp_list) %>% unlist()
t2 <- Sys.time()
t2 - t1 # 걸리는 시간
## Time difference of 6.910374 secs
length(my_title)
## [1] 40
head(my_title)
## [1] "My Networking Is Not Working! Conceptualizing the Latent and Dysfunctional Dimensions of the Network Paradigm"
## [2] "Remote network management for optical networks"
## [3] "Advanced optical networking<U+2014>Lucent's MONET network elements"
## [4] "Civil Society Networks: Options for Network Design"
## [5] "Introduction to Network Routing"
## [6] "Network"