jiangbeilu 发表于 2016-2-29 10:18 
出现乱码,就转换编码:我试过了,用下面的代码是可以的。
其中,iconv是用来转换编码的。
> baseURL="http://data.eastmoney.com/center/stock.html";
> table=readHTMLTable(baseURL,header=TRUE,which=1)
> iconv(table,"utf-8","gbk")
[1] "c(1, 3, 2)" "c(2, 1, 3)" "c(3, 2, 1)" "c(3, 2, 1)"
> table
V1 V2
1 鍗庣數鑳芥簮[7.14%]璇︽儏 琛屾儏 鍗庢柊姘存偿[10.06%]璇︽儏 琛屾儏
2 瀹佹尝鐑鐢礫-10.01%]璇︽儏 琛屾儏 鎬$悆璧勬簮[-10.02%]璇︽儏 琛屾儏
3 鍗庤锤鐗╂祦[10.03%]璇︽儏 琛屾儏 鎭掗