Skip to content

Instantly share code, notes, and snippets.

@Ray901
Last active August 29, 2015 14:24
Show Gist options
  • Save Ray901/ff0ec1a953442dde570a to your computer and use it in GitHub Desktop.
Save Ray901/ff0ec1a953442dde570a to your computer and use it in GitHub Desktop.
scrape taiwan population From web wiki
rm(list=ls())
library(rvest)
webwiki <- html("https://zh.wikipedia.org/wiki/%E8%87%BA%E7%81%A3%E8%A1%8C%E6%94%BF%E5%8D%80%E4%BA%BA%E5%8F%A3%E5%88%97%E8%A1%A8")
population <- webwiki %>%
html_nodes("#bodyContent table") %>%
html_table()
#View(population[[1]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment