“对象移动”在使用RCurl getURL函数以访问ASP页面时出错 [英] "Object Moved" error in using the RCurl getURL function in order to access an ASP Webpage

查看:174
本文介绍了“对象移动”在使用RCurl getURL函数以访问ASP页面时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 RCurl 套件的 getURL 功能,以访问 ASP 网页:

  my_url<  - http://www.my_site.org/my_site/main.asp?ID=11&REFID=33
网页< - getURL(my_url)

但我获得了对象移动重定向错误消息如:

 < head>< title> Object moved< / title>< / head& \ n< body>< h1>对象已移动< / h1> 
此对象可能会在< a HREF = \/my_site/index.asp\> here< / a> < / body> \ n



我遵循了各种建议,例如使用 curlEscape 网址编码函数,或者通过 curlSetOpt 函数设置 CURLOPT_FOLLOWLOCATION CCURLOPT_SSL_VERIFYHOST < //stackoverflow.com/questions/1279340/php-ssl-curl-object-moved-error\">php ssl curl:对象移动错误链接,但后来的2个无法被识别为有效的RCurl选项。 p>

任何建议如何解决这个问题?

解决方案

选项:

  getURL(u,.opts = curlOptions(followlocation = TRUE))

添加cookiefile goodness - 它应该是一个不存在的文件,但我不知道你如何可以肯定: p>

  w = getURL(u,.opts = curlOptions(followlocation = TRUE,cookiefile =nosuchfile))


I am trying to use the getURL function of RCurl Package in order to access an ASP Webpage as:

my_url <- "http://www.my_site.org/my_site/main.asp?ID=11&REFID=33"
webpage <- getURL(my_url)

but I get an Object Moved redirection error message like:

    "<head><title>Object moved</title></head>\n<body><h1>Object Moved</h1>
This object may be found <a HREF=\"/my_site/index.asp\">here</a>.</body>\n"

I followed various suggestions like using the curlEscape URL encoding function or by setting the CURLOPT_FOLLOWLOCATION and CCURLOPT_SSL_VERIFYHOST Parameters via the curlSetOpt Function as listed in the php ssl curl : object moved error link, but the later 2 were not recognized as valid RCurl options.

Any suggestions how to overcome the issue?

解决方案

Use the followlocation curl option:

getURL(u,.opts=curlOptions(followlocation=TRUE))

with added cookiefile goodness - its supposed to be a file that doesnt exist, but I'm not sure how you can be sure of that:

w=getURL(u,.opts=curlOptions(followlocation=TRUE,cookiefile="nosuchfile"))

这篇关于“对象移动”在使用RCurl getURL函数以访问ASP页面时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆