Вы были на правильном пути, что по этому поводу:
library(rvest)
library(tidyverse)
txt1 <- read_html("https://tr.wikisource.org/wiki/Recep_Tayyip_Erdo%C4%9Fan%27%C4%B1n_1_Haziran_2010_tarihli_AK_Parti_grup_toplant%C4%B1s%C4%B1_konu%C5%9Fmas%C4%B1")
txt2 <- read_html("https://tr.wikisource.org/wiki/Recep_Tayyip_Erdo%C4%9Fan%27%C4%B1n_1_Haziran_2011_tarihli_Diyarbak%C4%B1r_mitinginde_yapt%C4%B1%C4%9F%C4%B1_konu%C5%9Fma")
txt3 <- read_html("https://tr.wikisource.org/wiki/Recep_Tayyip_Erdo%C4%9Fan%27%C4%B1n_1_%C5%9Eubat_2011_tarihli_AK_Parti_grup_toplant%C4%B1s%C4%B1_konu%C5%9Fmas%C4%B1 " )
# first link
df1<- txt1 %>%
html_nodes('#mw-content-text p') %>% #choose the text
html_text() %>%
t() %>% # transpose
data.frame() %>% # as data.frame
unite() # melt all the cell in one text
То же самое для второй и третьей ссылок:
df2<- txt2 %>%
html_nodes('#mw-content-text p') %>%
html_text() %>% t() %>% data.frame() %>%unite()
df3<- txt3 %>%
html_nodes('#mw-content-text p') %>%
html_text() %>% t() %>% data.frame() %>%unite()
Последнее, что вы положили все в одну ячейку, например:
df_total <- cbind(df1,df2,df3) %>% unite()
РЕДАКТИРОВАТЬ:
Вы можете создать цикл, который анализирует все страницы в векторе ссылок:
txt1 <- ("https://tr.wikisource.org/wiki/Recep_Tayyip_Erdo%C4%9Fan%27%C4%B1n_1_Haziran_2010_tarihli_AK_Parti_grup_toplant%C4%B1s%C4%B1_konu%C5%9Fmas%C4%B1")
txt2 <- ("https://tr.wikisource.org/wiki/Recep_Tayyip_Erdo%C4%9Fan%27%C4%B1n_1_Haziran_2011_tarihli_Diyarbak%C4%B1r_mitinginde_yapt%C4%B1%C4%9F%C4%B1_konu%C5%9Fma")
txt3 <- ("https://tr.wikisource.org/wiki/Recep_Tayyip_Erdo%C4%9Fan%27%C4%B1n_1_%C5%9Eubat_2011_tarihli_AK_Parti_grup_toplant%C4%B1s%C4%B1_konu%C5%9Fmas%C4%B1 " )
url <- c(txt1, txt2, txt3) # all the urls
# the loop that scrapes and put in a list
dfList <- lapply(url, function(i)
{
swimwith <- read_html(i)
swdf <- swimwith %>%
html_nodes('#mw-content-text p') %>%
html_text()%>%
t() %>%
data.frame() %>%
unite()
})
# from list to df
finaldf1 <- do.call(cbind, dfList) %>% unite()