I am trying to download several files using web scraping. My code is the following:
library(XML);library(stringr)
url11="http://web.stanford.edu/~jurafsky/slp3/"
links = getHTMLLinks(url11)
links_data = links[str_detect(links, ".pptx")]
links_data
for(i in seq_along(links_data)){
a = NULL
a[i] = basename( links_data[i])
download.file(url11, destfile = a[i])
}
The code runs and it downloads all the files, in this case 13 files. However, all the files have the same size, despite the fact that they have different sizes in reality (I can check that if I download the files manually one by one). In addition, all the files are corrupt, I cannot open them using Power Point in this case. I'm using Windows 10, R version 3.4.1 64-bit, and RStudio Version 1.0.143. I would appreciate your help. Thanks in advance.