Skip to content

Instantly share code, notes, and snippets.

@coolbutuseless
Created September 13, 2018 07:57
Show Gist options
  • Save coolbutuseless/ba7611fc5e670812d4d3d6e7ac59a6d1 to your computer and use it in GitHub Desktop.
Save coolbutuseless/ba7611fc5e670812d4d3d6e7ac59a6d1 to your computer and use it in GitHub Desktop.
Download all the Brisbane City Council standard drawings
library(dplyr)
library(curl)
library(rvest)
library(xml2)
library(purrr)
# This script will download all the Brisbane City Council standard drawings.
bsd_url <- 'https://www.brisbane.qld.gov.au/planning-building/planning-guidelines-tools/planning-guidelines/standard-drawings'
xml2::read_html(bsd_url) %>%
html_nodes('option') %>%
map_chr(~rvest::html_attr(.x, 'value')) %>%
discard(~.x == '') %>%
map_chr(~paste0('https://www.brisbane.qld.gov.au/', .x)) %>%
walk(~curl::curl_download(.x, basename(.x), quiet=FALSE))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment