次のコードが示すように、html
in rvest
package はhtmlParse
from XML
package を使用します。.
html
function (x, ..., encoding = NULL)
{
parse(x, XML::htmlParse, ..., encoding = encoding)
}
<environment: namespace:rvest>
htmlParse
function (file, ignoreBlanks = TRUE, handlers = NULL, replaceEntities = FALSE,
asText = FALSE, trim = TRUE, validate = FALSE, getDTD = TRUE,
isURL = FALSE, asTree = FALSE, addAttributeNamespaces = FALSE,
useInternalNodes = TRUE, isSchema = FALSE, fullNamespaceInfo = FALSE,
encoding = character(), useDotNames = length(grep("^\\.",
names(handlers))) > 0, xinclude = TRUE, addFinalizer = TRUE,
error = htmlErrorHandler, isHTML = TRUE, options = integer(),
parentFirst = FALSE)
.....
したがって、次の URL の場合:
myurl<-"http://www.nepalstock.com.np/"
parse_XML<-htmlParse(myurl) #runs without error
parse_rvest<-html(myurl) # throws out the Internal Sever error
Error in parse.response(r, parser, encoding = encoding) :
server error: (500) Internal Server Error
何か案が?