Displaying 1 result from an estimated 1 matches for "htmlparsestarttag".
2010 Mar 11
1
parse an HTML page with verbose error message (using XML)
...rse() in the XML package, and I need a
little bit help on error handling while parsing an HTML page. So far I
can use either the default way:
# error = xmlErrorCumulator(), by default
library(XML)
doc = htmlParse("http://www.public.iastate.edu/~pdixon/stat500/")
# the error message is:
# htmlParseStartTag: invalid element name
or the tryCatch() approach:
# error = NULL, errors to be caught by tryCatch()
tryCatch({
doc = htmlParse("http://www.public.iastate.edu/~pdixon/stat500/",
error = NULL)
}, XMLError = function(e) {
cat("There was an error in the XML at line"...