getYoungMan <- function(){
URL='http://www.youngman.com.tw/shoplist.jsp?s=shop&city='
res <- GET(URL, encoding='utf8')
res2 <- content(res, encoding='utf8')
name <- xpathSApply(res2, '//*[@id="CONTENT02"]/table/tr/td/p/a', xmlValue)
addr <- xpathSApply(res2, '//*[@id="CONTENT02"]/table/tr/td[2]/p', xmlValue)
addr <- addr[-length(addr)]
tel <- xpathSApply(res2, '//*[@id="CONTENT02"]/table/tr/td[3]/p', xmlValue)
return(data.frame(brand_nm='年輕人眼鏡行',store_nm=name,addr=addr,tel_no=tel, stringsAsFactors = FALSE))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.