Last active
September 28, 2016 03:15
-
-
Save corynissen/744763abc6537f0e7b17 to your computer and use it in GitHub Desktop.
Get list of bus stop files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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