Tom
Tom

Reputation: 339

How to download whole folder that contain year several files with number at the beggining of its name?

I'm trying to download all .zip's files from this page:

https://danepubliczne.imgw.pl/data/dane_pomiarowo_obserwacyjne/dane_meteorologiczne/dobowe/synop/2011/

I'm using:

library(rvest) 

URL <- paste0("https://danepubliczne.imgw.pl/data/dane_pomiarowo_obserwacyjne/dane_meteorologiczne/dobowe/synop/2011/")

rh <- read_html(URL)
zips <- grep("zip$", html_attr(html_nodes(pg, "a[href^='2011']"), "href"), value=TRUE)

but the zips variable is empty. Any ideas?

Upvotes: 1

Views: 46

Answers (1)

fergusrg
fergusrg

Reputation: 59

With download_html (URL) you can download the page and you will see the name of all the zips; from there, you can build the URLs and download them.

Upvotes: 1

Related Questions