2017-05-18 91 views
1

我試圖從htmlParse未能加載外部實體

url <- ("http://angel.co/companies?locations[]=1647-India") 

代碼提取數據:

library(XML) 
my <- htmlParse(url) 

Error: failed to load external entity from url

嘗試2

library(XML) 
library(httr) 
qw <- GET(url) 
my <- readHTMLTable(rawToChar(qw$content)) 

Error in qw$content : $ operator is invalid for atomic vectors

嘗試3

qw <- getURL(url) 
my <- readHTMLTable(url, stringsAsFactors = F) 

Error: could not find function "getURL"

Error: failed to load external entity from url

回答

0

的網址給301地位,以及該原因是該網站只允許SSL連接。試試這個(本質上區別在於使用https而不是http)。

library(XML) 
library(RCurl) 
url <- ("https://angel.co/companies?locations[]=1647-India") 
htmlContent <- getURL(url) 
htmlTree <- htmlTreeParse(htmlContent) 
相關問題