阅读包含R和xml的网页

时间:2016-02-09 10:42:40

标签: xml r utf-8

我正在尝试从此网页enter link description here获取数据框进行分析(当您输入名称时,您会得到一张包含数据的表格)

我保存了网页代码并注明了,但它似乎无法正常工作

result <- xmlParse(file="mos.xml")

mos是带有网页代码的文件 我收到错误消息Erreur : 1: Input is not proper UTF-8, indicate encoding ! Bytes: 0xE9 0x65 0x73 0x20

我看到我必须使用$content = iconv('UTF-8', 'UTF-8//IGNORE', $content); $xml = simplexml_load_string( utf8_encode($rss) );来解决问题,但我不知道在哪里使用$ 谢谢

我也尝试过这种方法:

link <- "https://www.transparence.sante.gouv.fr/flow/rechercheEntreprises?execution=e7s3"
table = readHTMLTable(link, header=T, which=1,stringsAsFactors=F)

但我也收到错误消息

0 个答案:

没有答案