[問題] table問題(網頁編碼)

作者: vicror84 (阿汘)   2016-06-05 20:23:26
請問我想把亞東健檢中心(http://depart.femh.org.tw/HMC/wholebody.html)的表格爬下
來,但會出現亂碼在windows系統中,使用R語言,抓取表格呈現出亂碼,
我們將格式轉為繁體,
還是會呈現亂碼,我們研究出所有BIG5編碼的網頁,轉換後,還是亂碼,
程式如下:
library(XML)
URL = paste0("http://depart.femh.org.tw/HMC/wholebody.html")
doc<-htmlParse(URL,encoding="UTF-8")
tables<-readHTMLTable(doc,header=T,which = 2)
tables
dim(tables)
View(tables)

Links booklink

Contact Us: admin [ a t ] ucptt.com