Advertisement
celestialgod

crawler with rvest

Jul 7th, 2016
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.37 KB | None | 0 0
  1. library(rvest)
  2. library(httr)
  3. library(stringi)
  4. Sys.setlocale("LC_ALL", 'C') # for windows
  5. webpage <- GET("http://app.tzuchi.com.tw/tzuchi/About_TP_Center/?ContentType=6&IdentityID=130")
  6. dat <- webpage %>% content %>% html_nodes(xpath = "//table[@id='table15']") %>%
  7.   html_table(fill = TRUE) %>% `[[`(1)
  8. dat <- dat %>% as.matrix %>% stri_conv("UTF-8", "BIG5") # for windows
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement