目前有个需求,需要知道每天的收盘价,想在网上抓数据,但找不到合适的网站,希望炒股的朋友提供些网站,需要稳定一点的,网页好分析的,我只要收盘价就行了,我的数据库里面存了股票代码要求深市和沪市 以及基金

解决方案 »

  1.   

    http://quote.stockstar.com/什么都有,看你能不能抓取了。
      

  2.   

    http://stock.business.sohu.com/q/bc.php?code=600000
    <tr><td width=50 class=nati11 align=center>昨收盘</td><td width=100 class=nati11 align=left>&nbsp;31.04</td></tr>
    [/code]
    [code=Java]for(int i = 0; i < tickers.length; i++) {
    BufferedReader in = null;
    try {
    String ticker = tickers[i];
    String strUrl = "http://stock.business.sohu.com/q/bc.php?code=" + ticker;
    URL url = new URL(strUrl);
    in = new BufferedReader( new InputStreamReader( url.openStream())); String inputLine;
    while ((inputLine = in.readLine()) != null) {
    if(inputLine.indexOf("昨收盘") != -1) {
    //get price
    String price = inputLine.substring(inputLine.lastIndexOf("&nbsp;")+6, inputLine.lastIndexOf("</td>"));
                                    break;
    }
    }
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    try {
    if(in != null) in.close();
    } catch (Exception e) {}
    }
    }
      

  3.   

    目前找到的
    百度
    搜狐
    雅虎
    都是比较好解析的,其实最好有稳定提供数据源的,解析网页虽然可行但是感觉不靠谱,要用rss就好了.
      

  4.   

    哈哈,找到rss的话告诉我一下,我也不想解析网页,收费的feed也可以,不贵的话
      

  5.   

    网页解析有相关的资料没
    HTMLParser怎么样啊?
      

  6.   

    我写了个配置模板,有url和正则表达式就行了,大家只管提供网址就ok,最主要不能是ajax异步取的,这样我还要分析它的javascript大网站的js很难分析,有的还压缩过.例如新浪和网易就很难分析.
      

  7.   

    这个你得找个能给你提供数据接口的网站啊,让他们给你提供个xml就行,不过这好像个人没什么意义,一般公司都是这样和人家合作,你自己从网站抓去实在不好控制
      

  8.   

    http://www.webxml.com.cn这个提供稳定的XML数据源!