0

I'm trying to get a HTML code using httr and RCurl using proxies. The process is using a loop, and so every now and then I get the error message

Error in curl::curl_fetch_memory(url, handle = handle) : Couldn't connect to server

What I would like is to add a condition on this type of error, so that the running of the code won't stop everytime this happens.

nadavb
  • 128
  • 12
  • [http://stackoverflow.com/questions/39285570/error-in-curlcurl-fetch-memoryurl-handle-handle-couldnt-connect-to-ser](http://stackoverflow.com/questions/39285570/error-in-curlcurl-fetch-memoryurl-handle-handle-couldnt-connect-to-ser) – Shoukat Mirza May 06 '17 at 09:15

1 Answers1

0

I have managed to solve this problem using tryCatch and a while loop. As long as the function didn't return a specific value, I keep the while loop running. Explanation on how to use tryCatch I've found here.

Community
  • 1
  • 1
nadavb
  • 128
  • 12