When I execute htmlTreeParser(), I am getting this error:
Error in htmlTreeParse(webpage, error = function(...) { :
error in creating parser for
In addition: Warning message:
XML content does not seem to be XML: ''
Kindly someone help me to debug it.
library(RCurl)
library(XML)
theurl <- "http://www.forbes.com/powerful-brands/list/"
webpage <- getURL(theurl)
webpage <- readLines(tc <- textConnection(webpage)); close(tc)
pagetree <- htmlTreeParse(webpage, error=function(...){}, useInternalNodes = TRUE)