I am trying to clear the page. However, from time to time my loop does not work, because the parser "does not load the HTTP resource." The problem is that the page does not load in my browser, so this is not a problem with the code.
However, it is very unpleasant to restart the process after creating an exception on each page where I find an error. I wonder if there is a way to set the if condition. I am thinking of something like: if an error occurs, restart the loop in the next step.
I look at the help page for htmlParse and found that there is an error argument, but could not figure out how to use it. Any ideas for my if condition?
The following is a reproducible example:
if(require(RCurl) == F) install.packages('RCurl') if(require(XML) == F) install.packages('XML') if(require(seqinr) == F) install.packages('seqinr') for (i in 575:585){ currentPage <- i
source share