获得网页的内容,如http://www.newdruginfo.com/sms/ha001.htm里的正文内容
从 <table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>
<td align='center' height='50'><b>阿苯达唑胶囊</b></td>到<td height='30'><font color='#0000FF'><b>【有效期】</b></font></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
所有内容,怎么提取呀!请大侠帮忙呀!

解决方案 »

  1.   

        String str = "<table   width='100%'   border='0'   cellspacing='0'   cellpadding='0'> <tr><td   align='center'   height='50'> <b> 阿苯达唑胶囊 </b> </td>到<td   height='30'> <font   color='#0000FF'> <b> 【有效期】 </b> </font> </td></tr><tr><td> </td></tr><tr> ";
        System.out.println(str.replaceAll("<([^<>]+?)>",""));
      

  2.   

    System.out.println(str.replaceAll("<.*?>",""))
      

  3.   

    希望用       java.net.URL url=new java.net.URL("http://www.newdruginfo.com/sms/ha001.htm");
         BufferedReader in=new BufferedReader(new InputStreamReader(url.openStream(),"gb2312"));这样的方法来实现
      

  4.   

    ...StringBuilder b = new StringBuilder();
    String line = null;
    while((line=in.readLine())!=null){
      b.append(line+"\r\n");
    }
    String rtn = b.toString().replaceAll("<.*?>","");
      

  5.   

    java2000_net 加我QQ,我有问题想问你!401130076
    我想输出一个网页中的所有url地址,如何实现呢,我都找了两天了!