我遇到这种情况,我必须在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&AspxAutoDetectCookieSupport=1">here</a>.</h2>
</body></html>
然后我尝试了curl -L
并获得了该文件。
为什么会这样?我自动阅读了open-uri
重定向。
我该怎么做?