我有一个网站,有数百个PDF。我需要遍历并下载每个PDF到我的本地机器。我想使用rvest。尝试:
library(rvest)
url <- "https://example.com"
scrape <- url %>%
read_html() %>%
html_node(".ms-vb2 a") %>%
download.file(., 'my-local-directory')
如何从链接中抓取每个PDF?download.file()
不工作,我也不知道如何获取每个文件。我只是得到了这个错误:
编码中出现编码错误(x,
=doc_parse_raw,base_url = base_url,as_html = as_html,:xmlParseEntityRef: no name 68
https://stackoverflow.com/questions/53820356
复制相似问题