Open-URI不遵循重定向(不确定)

时间:2014-01-18 11:10:36

标签: ruby curl mechanize open-uri

我遇到这种情况,我必须在ruby中阅读这个网址:

http://tamilnadu.schools9.com/anna-university-grade-system-chennai.aspx?htno=211511104125

现在,当我做

require 'open-uri'
open "http://tamilnadu.schools9.com/anna-university-grade-system-chennai.aspx?htno=211511104125" 
没有任何反应!我不得不打断它停下来。我很困惑,因为它在浏览器中运行良好。

但后来我尝试了卷曲,我得到了:

<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/anna-university-grade-system-chennai.aspx?htno=211511104125&amp;AspxAutoDetectCookieSupport=1">here</a>.</h2>
</body></html>

然后我尝试了curl -L并获得了该文件。

为什么会这样?我自动阅读了open-uri重定向。 我该怎么做?

0 个答案:

没有答案