Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用{RCurl}的代理身份验证_R_Curl_Web - Fatal编程技术网

使用{RCurl}的代理身份验证

使用{RCurl}的代理身份验证,r,curl,web,R,Curl,Web,作为网络编程方面的专家,我尝试自动化一项任务,该任务包括进入网站,下载一些csv文件,最后将其导入R中进行数据分析 在这种情况下,我正在处理互联网上的以下示例代码,该代码已根据我的需要进行了一些定制,我想知道更多有关由此产生的错误的信息: library(RCurl) curl = getCurlHandle() curlSetOpt(cookiejar = 'cookies.txt', followlocation = TRUE, autoreferer = TRUE, curl = cur

作为
网络编程方面的专家
,我尝试自动化一项任务,该任务包括进入网站,下载一些
csv
文件,最后将其导入R中进行数据分析

在这种情况下,我正在处理互联网上的以下示例代码,该代码已根据我的需要进行了一些定制,我想知道更多有关由此产生的错误的信息:

library(RCurl)
curl = getCurlHandle()
curlSetOpt(cookiejar = 'cookies.txt', followlocation = TRUE, autoreferer = 
TRUE, curl = curl)

# Load the page for the first time to capture VIEWSTATE:

html <- getURL('https://www.olisnet.com/OlisAuthenticate/JSP/login.jsp',  
curl = curl, 
           .opts=list(ssl.verifypeer=FALSE))

# Extract VIEWSTATE with a regular expression or any other tool:

viewstate <- as.character(sub('.*id="__VIEWSTATE" value="([0-9a-zA-  
Z+/=]*).*', '\\1', html))

# Set the parameters as your username, password and the VIEWSTATE:

params <- list(
'user'         = '<USERNAME>',
'pass'         = '<PASSWORD>',
'__VIEWSTATE'                                  = viewstate
)

html = postForm('https://www.olisnet.com/OlisAuthenticate/JSP/login.jsp',   
.params = params, curl = curl,.opts=list(ssl.verifypeer=FALSE))     
 Error: Proxy Authentication Required

# Verify if you are logged in:
grepl('Logout', html)
[1]FALSE
库(RCurl)
curl=getCurlHandle()
curlSetOpt(cookiejar='cookies.txt',folloLocation=TRUE,autoreferer=
TRUE,curl=curl)
#首次加载页面以捕获VIEWSTATE:
html