getTinTin <- function(){
res <- GET('http://www.norbelbaby.com.tw/TinTin/work.jsp')
res <- content(res)
resultTp <- readHTMLTable(res)
result <- resultTp[[1]]
result <- sapply(result, str_replace_all, pattern = '[:space:]+', replacement = '')
result <- as.data.frame(result, stringsAsFactors = FALSE)
index <- str_detect(result$V2,'^[0-9]+-[0-9]+')
result <- result[ index&(!is.na(index)),]
result$V4 <- NULL
head(result)
names(result) <- c('store_nm', 'tel_no', 'addr', 'open' )
result$tel_no <- str_replace_all(result$tel_no, '-', '')
row.names(result) <- 1:nrow(result)
result <- data.frame(brand_nm='丁丁藥局', as.matrix(result), stringsAsFactors = FALSE)
return(result)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.