kr.investing_0525 <- c()
news_href <- c()
for (pageNo in 1) {
urls <- paste0("https://kr.investing.com/news/stock-market-news/",pageNo)
get_url <- GET(urls)
html_source <- read_html(get_url)
my_nodes <- html_nodes(html_source,".textDiv > a.title")
my_href <- html_attr(my_nodes,"href")
news_href <- paste0("https://kr.investing.com",my_href)
for (i in 1:36) {
T.selector <- paste0("#leftColumn > div.largeTitle > article:nth-child(",i,") > div.textDiv > a")
title_nodes <- html_nodes(html_source,T.selector)
text_title <- html_text(title_nodes)
kr.investing_0525 <- c(kr.investing_0525,text_title)
}
}
df <- data.frame(kr.investing_0525)
href_df <- data.frame(news_href)
df