draft/getKingstone.R

getKingstone <- function(){
  URL='http://www.kingstone.com.tw/about/about_2.asp'
  res <- GET(URL, encoding='utf8')
  res2 <- content(res, encoding='utf8')
  
  name <- xpathSApply(res2, '///*[@id="Others"]/tr/td[4]/a', xmlValue)
  addr <- xpathSApply(res2, '//*[@id="Others"]/tr/td[5]', xmlValue)
  tel <- xpathSApply(res2, '//*[@id="Others"]/tr/td[6]', xmlValue)
  
  return(data.frame(brand_nm='金石堂',store_nm=name,addr=addr,tel_no=tel, stringsAsFactors = FALSE))
}
leoluyi/CRMaddress documentation built on May 21, 2019, 5:08 a.m.