draft/getYogi.R

getYogi <- function(){
  res <- GET("http://www.yogi-house.com/store.php?lo=all")
  res <- htmlParse(res, encoding = 'utf8')
  
  store_nm=xpathSApply(res, '//*[@class="store-list"]/a[@class="store-name"]', xmlValue)
  tel_no=xpathSApply(res, '//*[@class="store-list"]/p[1]', xmlValue)
  addr=xpathSApply(res, '//*[@class="store-list"]/p[2]', xmlValue)
  
  FINISH= data.frame(brand_nm='無毒的家',store_nm=store_nm,addr=addr,tel_no=tel_no,data_dt=gsub('-','',Sys.Date()) ,stringsAsFactors=FALSE )
  return(FINISH)
}
leoluyi/CRMaddress documentation built on May 21, 2019, 5:08 a.m.