getNike <- function(){
URL <- 'http://www.nike.com/tw/zh_tw/sl/find-a-store?display_country=TW'
res <- GET(URL, user_agent("mozilla/5.0"))
res2 <- htmlParse(content(res, "text", encoding = "utf8"),encoding = "utf8")
store_nm=xpathSApply(res2, '//*[@id="台灣"]/ul/li/a/div[1]', xmlValue)
addr=xpathSApply(res2, '//*[@id="台灣"]/ul/li/a/div[2]', xmlValue)
addr <- str_replace_all(addr, '(\r|\n| |\t)+', '')
FINISH= data.frame(brand_nm='Nike',store_nm=store_nm,addr=addr, data_dt=gsub('-','',Sys.Date()) ,stringsAsFactors=FALSE )
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.