LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1240|回复: 7

wget 的自动跳转的问题

[复制链接]
发表于 2005-9-20 12:38:07 | 显示全部楼层 |阅读模式
我用wget下载ACS上面的文献,得到下面的内容,按道理网页里面含有http-equiv=refresh的话wget会自动跳转到后面的地址的。可是wget并没有跳转,什么原因呢?请高手们指教,谢谢!



  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4.   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5.   <noscript>
  6.     <meta http-equiv="refresh" content="3;URL=/cgi-bin/abstract.cgi/jmcmar/2004/47/i01/pdf/jm030209y.pdf?sessid=5111">
  7.   </noscript>
  8. <script>
  9. <!--
  10. v3 = 0; op = 0; ie4  = 0; ie5 = 0; nn4 = 0; nn6 = 0; isMac = 0; aol = 0;
  11. if(document.images){
  12.     if(navigator.userAgent.indexOf("Opera") != -1){
  13.         op = 1;
  14.     } else {
  15.         if(navigator.userAgent.indexOf("AOL") != -1){
  16.             aol = 1;
  17.         } else {
  18.             ie4 = (document.all && !document.getElementById);
  19.             nn4 = (document.layers);
  20.             ie5 = (document.all && document.getElementById);
  21.             nn6 = (document.addEventListener);
  22.         }
  23.     }
  24. } else {
  25.     v3 = 1;
  26. }

  27. if(navigator.userAgent.indexOf("Mac") != -1){
  28.     isMac = 1;
  29. }
  30. // -->
  31. </script>
  32.   <script language="JavaScript1.1" type="text/javascript">    var today = new Date();    today.setTime(today.getTime() + 5000);    document.cookie = 'ACS_SURFAID=/cgi-bin/abstract.cgi/jmcmar/2004/47/i01/pdf/jm030209y.pdf;path=/;expires='+today.toGMTString()+';';    var dest="/cgi-bin/abstract.cgi/jmcmar/2004/47/i01/pdf/jm030209y.pdf";    var cookieValid = document.cookie;    if (nn4 || cookieValid.indexOf("ACS_SURFAID=") == -1)    {      dest="/cgi-bin/abstract.cgi/jmcmar/2004/47/i01/pdf/jm030209y.pdf?sessid=7101";    }    SA_Location = location.protocol +"//" + location.host + "/cgi-bin/abstract.cgi/jmcmar/2004/47/i01/pdf/jm030209y.pdf";    SA_Referral = "";          SA_ID = "acspix;acspix";  </script>
  33.   <script language="JavaScript1.1" type="text/javascript" src="//stats.surfaid.ihost.com/sacdcg3p_acspix_acspix.js"></script>
  34. </head>
  35. <body onLoad="window.location.replace(location.protocol + '//' + location.host + dest);">
  36. <noscript><img src="//stats.surfaid.ihost.com/crc/images/uc.GIF?1.20&acspix&acspix&noscript" height="1" width="1" alt="" border="0"></noscript>
  37. <center>
  38. <br>
  39. <br>
  40. <br>
  41. <img src="http://pubs.acs.org/images/acslogo.gif" width="350" height="65">
  42. <br>
  43. <br>
  44. <font size="2" face="Arial, Helvetica, sans-serif">The page you have requested is loading. <a href="http://pubs.acs.org/cgi-bin/abstract.cgi/jmcmar/2004/47/i01/pdf/jm030209y.pdf?sessid=7101">Click here if your browser does not automatically redirect you.</a></font>
  45. </center></body>
  46. </html>
复制代码
发表于 2005-9-20 13:14:21 | 显示全部楼层
那就是它不支持这个跳转呗。哈哈!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-20 13:55:39 | 显示全部楼层
楼上的别灌水啊,说点实在的吧。

我看了wget的源码,它明明就是检查到
meta http-equiv="refresh" content="NUMBER; URL= "..."
这样的就直接跳转的,按道理改版了的ACS也应当符合这种情况,可它就是不跳转
回复 支持 反对

使用道具 举报

发表于 2005-9-20 18:34:13 | 显示全部楼层
确实有,哪里的URL,我帮你分析一下吧!
回复 支持 反对

使用道具 举报

发表于 2005-9-20 19:08:20 | 显示全部楼层
试试curl,这个也许可以。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-21 14:07:33 | 显示全部楼层
curl也不行。

谢谢楼上的,是美国化学会的网址,不知你们学校有没有权限
http://pubs.acs.org/cgi-bin/abst ... 1/pdf/jm030209y.pdf
回复 支持 反对

使用道具 举报

发表于 2005-9-21 23:01:44 | 显示全部楼层
用我写的这个myget吧,http://www.linuxfans.org/nuke/mo ... eninfo&did=3636
你给的这个链接本身就有些问题,但是wget也有问题,我没有仔细看他为什么没有跟踪到他这个链接,我猜测可能是他根本就没有调用那个parsehtml的函数,并且关于http的状态码分析也不是很完全的。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-22 15:17:54 | 显示全部楼层
多谢多谢!正在下载,看起来功能很强大啊,牛人啊

你给的这个链接本身就有些问题
不知可否说说是什么问题,谢谢了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表