draft/getEcosway.R

getEcosway <- function(){
  
  wantURL <- 'http://www.ecosway.net.tw/ecosway_taiwan/download/salecenter2_tw_details.html'
  res=htmlParse(wantURL, encoding='big5')
  
  
  store_nm=xpathSApply(res, '/html/body/table/tr/td/table/tr/td/table/tr/td[2]', xmlValue)
  store_nm=store_nm[-1]
  addr=xpathSApply(res, '/html/body/table/tr/td/table/tr/td/table/tr/td[3]', xmlValue)
  addr=addr[-1]
  tel_no=xpathSApply(res, '/html/body/table/tr/td/table/tr/td/table/tr/td[4]', xmlValue)
  tel_no=tel_no[-1]
  open_time=xpathSApply(res, '/html/body/table/tr/td/table/tr/td/table/tr/td[5]', xmlValue)
  open_time=open_time[-1]
  
  FINISH= data.frame(brand_nm='科士威',store_nm=store_nm,addr=addr,tel_no=tel_no,open_time=open_time, data_dt=gsub('-','',Sys.Date()) ,stringsAsFactors=FALSE )
}
leoluyi/CRMaddress documentation built on May 21, 2019, 5:08 a.m.