[英]getURL in RCurl problem behind firewall R
我在醫院防火牆后面,通常必須使用setInternet2(T)
來正確訪問網絡。 然而,運行我的代碼(在家里完美運行)會導致
curlPerform(curl = curl, .opts = opts, .encoding = .encoding) :
Could not resolve host: www.cnn.com; Host not found
是否可以解決這個問題?
問候,
//中號
看起來RCurl不使用與R相同的代理設置(因此設置internet2沒有幫助),您需要使用curlSetOpt
命令手動設置它們:
curl <- getCurlHandle()
curlSetOpt(.opts = list(proxy = '<address>:<port>'), curl = curl)
ans <- getURL('http://www.cnn.com', curl = curl)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.