问题
I use Rstudio server, and the packages RCurl and XML. I tried to scrape a webpage, but after having done it once successfully, I got the error message:
Error in curlPerform(curl = curl, .opts = opts, .encoding = .encoding) :
couldn't connect to host
when trying to get the URL:
getURL(my_url, encoding="UTF-8", followLocation = TRUE)
Any ideas why this is happening?
回答1:
Maybe you should try setting your RCurlOptions:
options(RCurlOptions = list(proxy = "my.proxy", proxyport = my.proxyport.number))
I hope it helps.
来源:https://stackoverflow.com/questions/7620123/rcurl-error-couldnt-connect-to-host