Web Scraping in R with loop from data.frame
问题 library(rvest) df <- data.frame(Links = c("Qmobile_Noir-M6", "Qmobile_Noir-A1", "Qmobile_Noir-E8")) for(i in 1:3) { webpage <- read_html(paste0("https://www.whatmobile.com.pk/", df$Links[i])) data <- webpage %>% html_nodes(".specs") %>% .[[1]] %>% html_table(fill = TRUE) } want to make loop works for all 3 values in df$Links but above code just download the last one, and downloaded data must also be identical with variables (may be a new column with variables name) 回答1: The problem is in how