RCurl, error: couldn't connect to host

梦想与她 提交于 2019-12-11 18:13:33

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!