draft/getWonderPet.R

getWonderPet <- function(){
  URL="http://www.wonderpet.asia/construct/construct_wonderpet.html"
  res <- GET(URL, encoding='utf8')
  res2 <- htmlParse(content(res, "text", encoding = "utf8"), encoding = "utf8")
  
  tables <- readHTMLTable(res2)
  data_table=tables[[1]]
  data_table=data_table[3:NROW(data_table),]
  for(i in 2:length(tables)){
    data_table <- rbind(data_table,tables[[i]][2:NROW(tables[[i]]),])
  }
  data_table<-na.exclude(data_table)
  data_table<-data_table[,1:3]
  Title = c("store_nm","tel_no","addr")
  colnames(data_table)=Title
  brand_nm='寵物公園'
  store_info<-cbind(brand_nm,data_table)
}
leoluyi/CRMaddress documentation built on May 21, 2019, 5:08 a.m.