Skip to content

Instantly share code, notes, and snippets.

@expersso
Created May 13, 2015 16:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save expersso/4ac33b9c00751fddc7f8 to your computer and use it in GitHub Desktop.
Save expersso/4ac33b9c00751fddc7f8 to your computer and use it in GitHub Desktop.
library(dplyr); library(httr); library(rvest)
addr <- "Big Ben"
GET("http://maps.google.com/maps/api/geocode/xml",
query = list(address = addr)) %>%
content() %>%
html_nodes(xpath = "//location//lat | //location//lng") %>%
html_text() %>%
setNames(c("lng", "lat"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment