我用idhttp读取 http://www.t7online.com/China/Chengdu.htm 网页上的源代码,感觉网页上有很多版块,我只读到主版块,我该如何读取其他版块上“7天”链接上的网页地址,因为链接的网页地址每天都是随机的。

解决方案 »

  1.   

    那要分析html源码,找出这个"7天"的链接地址,再用http读取
      

  2.   

    我通过程序读取网页内容  只有几行  而我右键点‘7天’按钮旁空白处 显示源代码   出来代码很多  我就不知道该如何能读到那个代码 lin:='http://www.t7online.com/China/Chengdu.htm';
     with IdHTTP1.Request do
      begin
        ContentType :='application/x-www-form-urlencoded';
        UserAgent :='Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)';
      end;
     
      try
        MyStr1:=IdHttp1.Get(lin);  except
        Showmessage('网络出错!');
        Exit;
      end;
      showmessage(mystr1);
      

  3.   

    frame src 源代码里是不是有好几个 上边这两个词啊... 这就是了.,
    把src= 后边的网面地址 用idhttp去Get得到的就是你想要的东西啦... 
      

  4.   

    我试了  把每个地址都显示了一下,但是没有我要的那个,  因为‘7天’链接的网址每天是随机,所以只有想办法通过主页来读,但是就是找不到。   求高人指点。
    下面是显示出来的代码
    <link rel="canonical" href="http://www.t7online.com/China/Chengdu.htm">
    </head>
    <frameset cols="10,800,*" border="0" frameborder="0" framespacing="0">
     <frame src="http://wodas.t7online.com/static/wo_leftsky.htm" name="cntlinks" noresize scrolling="no" marginwidth="0" marginheight="0">
     <frameset rows="90,30,*" border="0" frameborder="0" framespacing="0">
      <frame src="http://wodas.t7online.com/dynamic/wo_bf.fcgi?LANG=cn&KONT=cncn&LAND=CI&WMO=56294&ORTN=成都" noresize scrolling="no" name="werbung" marginwidth="0" marginheight="0">
      <frame src="/cncn_akt.htm" noresize scrolling="no" marginwidth="0" marginheight="0">
      <frameset cols="150,*" border="0" frameborder="0" framespacing="0">
      <frame src="/include/cncn_region_vor.htm" scrolling="auto" name="linke_leiste" noresize marginwidth="0" marginheight="0">
      <frame src="/cgi-bin/region?PRG=citybild&CONT=cncn&CREG=hkch&WMO=56294&LAND=CI&LANG=cn" scrolling="auto" name="WOcontent" noresize marginwidth="0" marginheight="0">
      </frameset>
     </frameset>
     <frame src="http://wodas.t7online.com/dynamic/wo_sky.fcgi?LANG=cn&KONT=cncn&LAND=CI&WMO=56294&ORTN=成都" name="cntrechts" noresize scrolling="no" marginwidth="0" marginheight="0">
    </frameset>
    </html>
      

  5.   

    何必呢
    http://weather.xcyh.org/
    各种格式,自己喜欢看着办
      

  6.   

      fhttp.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; BTRS124342; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)';
      fhttp.Get('http://www.t7online.com/China/Chengdu.htm',stream);
       //得到/cgi-bin/region?PRG=citybild&CONT=cncn&CREG=hkch&WMO=56294&LAND=CI&LANG=cn  fhttp.Request.Referer:= 'http://www.t7online.com/China/Chengdu.htm';
      str:= fhttp.Get('http://www.t7online.com/cgi-bin/region?PRG=citybild&CONT=cncn&CREG=hkch&WMO=56294&LAND=CI&LANG=cn');
      //得到/cgi-bin/citybild?WMO=56294&LANG=cn&BKM=Sichuan/Chengdu&SID=b
     //在这个URL后边加上 '#citydetail_window' 就是你想要的路径  str:= fhttp.Get('http://www.t7online.com/cgi-bin/citybild?WMO=56294&LANG=cn&BKM=Sichuan/Chengdu&SID=b'+ '#citydetail_window');//这里就得到你所需要的页面容了。。  这个地址是固定的吧。 应该不是动态变的
      

  7.   

    重新发下。。 那样看效果不好。。fhttp.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; BTRS124342; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)';
      fhttp.Get('http://www.t7online.com/China/Chengdu.htm',stream);
      //得到/cgi-bin/region?PRG=citybild&CONT=cncn&CREG=hkch&WMO=56294&LAND=CI&LANG=cn  fhttp.Request.Referer:= 'http://www.t7online.com/China/Chengdu.htm';
      str:= fhttp.Get('http://www.t7online.com/cgi-bin/region?PRG=citybild&CONT=cncn&CREG=hkch&WMO=56294&LAND=CI&LANG=cn');
      //得到/cgi-bin/citybild?WMO=56294&LANG=cn&BKM=Sichuan/Chengdu&SID=b
     //在这个URL后边加上 '#citydetail_window' 就是你想要的路径  str:= fhttp.Get('http://www.t7online.com/cgi-bin/citybild?WMO=56294&LANG=cn&BKM=Sichuan/Chengdu&SID=b'+ '#citydetail_window');
      

  8.   


    fhttp.Get('http://www.t7online.com/China/Chengdu.htm',stream);
    改为
    str:= fhttp.Get('http://www.t7online.com/China/Chengdu.htm');
    就可以了
      

  9.   

    太感谢jiajiajing6了,昨晚弄了一晚  已经做好了,谢谢!