error failed to load an external entity http

Same error here, but it seems to work with another libraries, like xml2 and rvest, so try following snippet:

library(data.table)
library(rvest)
library(xml2)

pages <- c(1:2)

urls <- rbindlist(lapply(pages, function(x) {
  url <- paste("http://www.r-users.com/jobs/page/",x,"/", sep="")
  data.frame(url)
}), fill=TRUE)

jobLocations <- data.table::rbindlist(apply(urls, 1, function(url) {    
    nodes <- html_nodes(read_html(url), xpath = '//*[@id="mainContent"]/div[2]/ol/li/dl/dd[3]/span/text()')
    text <- html_text(nodes)
    data.frame(text)
}), fill=TRUE)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top