get3m <- function(){
wantURL <- 'http://solutions.3m.com.tw/wps/portal/3M/zh_TW/TWCHIMPurewater/home/w/whereToBuy2/'
res=htmlParse(wantURL, encoding='utf8')
store_nm=xpathSApply(res, '//*[@class="ui-block-a"]/a', xmlValue)
addr=xpathSApply(res, '//*[@class="ui-grid-a ui-responsive"]/div[@class="ui-block-b"]/text()', xmlValue)
addr <- str_replace_all(addr, '(\r|\n| |\t)+', '')
addr=addr[addr!='']
FINISH= data.frame(brand_nm='3M',store_nm=store_nm,addr=addr, data_dt=gsub('-','',Sys.Date()) ,stringsAsFactors=FALSE )
return(FINISH)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.