FT,那个看起来像手工每日更改的。你去Google搜一个预报的接口,去Yahoo的我的yahoo看看,里面有各地预报

解决方案 »

  1.   

    类似这样的:
    <IFRAME name="bottom" BORDER=0 FRAMEBORDER=0  scrolling="no" WIDTH=800 HEIGHT=600
                SRC="http://www.21cn.com/sky/cityweather.asp?city=东莞&temptype=1" align="right" > </IFRAME>但有个缺点,很难控制它的格式,因为它的格式不适合我
    最好是能有JAVASCRIPT代码,我可以随意安排格式在我自己王网站上!
      

  2.   

    我以前做过,用流读出SOHU天气预报页面的源文件,然后取出其中需要的部分下面是以前写的,你可以修改一下<%@ page contentType="text/html;charset=gb2312"%>
    <%@ page import = "java.net.*, java.io.*" %>
    <%
    // 读取页面内容
    URL url = new URL("http://gather.sohu.com/life/forecast/index.asp");
    URLConnection conn = url.openConnection();
    InputStream inStream = conn.getInputStream();
    BufferedReader reader = new BufferedReader(new InputStreamReader(inStream));
    StringBuffer buffer = new StringBuffer();
    int data;
    while( (data = reader.read()) != -1) {
    buffer.append((char)data);
    }
    reader.close();
    inStream.close();//System.out.println(buffer);
    String content = new String(buffer);
    // 查找成都天气
    content = content.substring(content.indexOf("城市:成都") + 9, content.indexOf("城市:贵阳") - 191);
    // 输出天气
    out.println(content);
    %>
    <%out.println("<br><br><font color=red>成都天气预报</font>");%>
      

  3.   

    content = content.substring(content.indexOf("城市:杭州") + 9, content.indexOf("城市:宁波") - 191);
    改为这句话就报错了,另外你的成都的天气也没数据显示
      

  4.   

    谁能解决我给500分,如果谁有代码也可以发我的EMAIL:[email protected]