I'm trying to get a list of all the XML documents in a web server directory (and all its subdirectories).
I've tried these examples:
One:
library(XML)
url <- "https://cmgds.marine.usgs.gov/metadata/pcmsc/"
getHTMLLinks(url)
Returns: character(0) Warning message: XML content does not seem to be XML
Two:
readHTMLTable(url)
Returns the same error.
I've tried other sites as well, like those included in the examples. I saw some SO questions (example) about this error saying to change https
to http
. When I do that I get Error: failed to load external entity
.
Is there a way I can get a list of all the XML files at that URL and all the subdirectories using R?