I am trying to scrape the API for some information. I get about 300 or so in everytime I run my code before it stops with a "cannot open the connection" messagge. Was just wondering if anyone had any idea what was causing this issue and how it could be resolved?
Here is my code in R.
I have confirmed that when it is running it is gathering the data what seems to be 100% accurate
while (i < 76127) {
urltemp = paste(url1,i,url2, sep = "")
con = url(urltemp, "rb")
json = fromJSON(con)
new = tryCatch(data.frame(json), error=function(e) NULL)
data = rbind(data, new)
i = i + 1
}
Log in to comment