Skip to content

Instantly share code, notes, and snippets.

@corynissen
Last active September 28, 2016 03:15
Show Gist options
  • Save corynissen/744763abc6537f0e7b17 to your computer and use it in GitHub Desktop.
Save corynissen/744763abc6537f0e7b17 to your computer and use it in GitHub Desktop.
Get list of bus stop files
library(XML)
library(httr)
url1 <- "http://www.district87.org/pages/Bloomington_School_District_87/Parents_and_Students/Bus_Routes/Bloomington_High_School"
x <- GET(url1)
text <- content(x, as="text")
doc <- htmlParse(text)
a <- xpathSApply(doc, "//table[@id='fsvItemsTable']/tr")
links <- xpathSApply(a[[1]], "//a/@href")
links <- links[grepl("^/files", links)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment