且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

readHTMLTable 和 UTF-8 编码

更新时间:2023-11-27 13:59:34

有一段时间,我与 XML 包的创建者 Duncan Temple Lang 一起发邮件.昨天(30.01.2012)他在Omegahat网站上上传了新版本的XML包.31 位 R 版本的新版本 3.9-4 消除了这个编码问题!:)

for some time I was mailing with Duncan Temple Lang, the creator of XML package. Yesterday (30.01.2012) he uploaded new version of XML package on Omegahat website. New version 3.9-4 for 31bit version of R remove this encoding problem! :)

下载包形式链接如下:http://www.omegahat.org/R/bin/windows/contrib/2.14/

library(XML)
url<-paste("http://allegro.pl/listing.php/search?category=15821&sg=0&p=",1:5,"&string=facebook",sep="")
doc = htmlParse(url[1], encoding = "UTF-8")
z = as.data.frame(readHTMLTable(doc, stringsAsFactors = FALSE)$lista)

它有效,所以我们可以关闭这个话题.:)

It works, so we can close this topic. :)