download_xml {xml2} | R Documentation |
Download a HTML or XML file
download_xml(url, file = basename(url), quiet = TRUE, mode = "wb", handle = curl::new_handle()) download_html(url, file = basename(url), quiet = TRUE, mode = "wb", handle = curl::new_handle())
url |
A character string naming the URL of a resource to be downloaded. |
file |
A character string with the name where the downloaded file is saved. |
quiet |
If |
mode |
A character string specifying the mode with which to write the file.
Useful values are |
handle |
a curl handle object |
The main difference between curl_download
and curl_fetch_disk
is that curl_download
checks the http status code before starting the
download, and raises an error when status is non-successful. The behavior of
curl_fetch_disk
on the other hand is to proceed as normal and write
the error page to disk in case of a non success response.
Path of downloaded file (invisibly).
## Not run: download_html("http://tidyverse.org/index.html") ## End(Not run)