Skip to content

第一个范例就跑不出来 #13

@GreenEric

Description

@GreenEric
library(stringr)
library(XML)
library(maps)

surl  <-  "https://en.wikipedia.org/wiki/List_of_World_Heritage_in_Danger"

heritage_parsed <- htmlParse(surl,encoding="UTF-8")
tables <- readHTMLTable(heritage_parsed,stringsAsFactors=FALSE)

在surl中,如果按照原文是http,就出来以下错误

> heritage_parsed <- htmlParse(surl,encoding="UTF-8")
Error: failed to load external entity "http://en.wikipedia.org/wiki/List_of_World_Heritage_in_Danger"

如果改为https,就成了这样,

> Warning message:
XML content does not seem to be XML: 'https://en.wikipedia.org/wiki/List_of_World_Heritage_in_Danger' 

感谢

请问何解?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions