1

I am having a problem with combining multiple pages with RJSONIO.

Base version: If I try with one page, it works:

test11<-RJSONIO::fromJSON("http://zoeken.kvk.nl/Address.ashx?site=handelsregister&q=01000040")
df<-ldply(test11, data.frame)

However, when I try to automate the process for multiple pages, then the list stays empty. I used the following code:

baseurl <- "http://zoeken.kvk.nl/Address.ashx?site=handelsregister"
pages <- list()
for(i in 01000039:01000066){
  mydata <- RJSONIO::fromJSON(paste0(baseurl, "&q=", i))
  message("Retrieving page ", i)
  pages[[i+1]] <- mydata$resultatenHR
}

#combine all into one
filings <- rbind_pages(pages)

#check output
nrow(filings)

Nothing happens, and the 'pages' list is empty, and the mydata is also empty. I tried using another json package, but with the other packages (jsonlite and rjason) I get an error message:

"Error in open.connection(con, "rb") : Timeout was reached: Connection timed out after 10000 milliseconds"

Thanks in advance for any reply

RobertHaa
  • 79
  • 2
  • 10

0 Answers0