java代码如下
InputStreamReader isr = new InputStreamReader(getHC.getResponseBodyAsStream(), charset); // 设置读取流的编码格式,自定义编码
java.io.BufferedReader br = new java.io.BufferedReader(isr);
String tempbf;
StringBuffer sb =new StringBuffer();
while((tempbf=br.readLine())!=null){
sb.append(tempbf);
}
isr.close();
getHC.abort();
_content = sb.toString();
java.io.BufferedReader br = new java.io.BufferedReader(isr);
String tempbf;
StringBuffer sb =new StringBuffer();
while((tempbf=br.readLine())!=null){
sb.append(tempbf);
}
isr.close();
getHC.abort();
_content = sb.toString();
网页html代码如下
<tr bgcolor="#e5efc1" height="20"><td> <a onclick="ToolOut()
return false;" href="">取 消</a> </td></tr></table>
</td></tr></table>
<input type="button" value="退回操作" style="display:none" name="btnReturn" onclick="return _doClick('482573F900304793.6cae365d160923be482573df0033310e/$Body/0.129C', this, null)">
<div class="title"><font face="宋体">电 子 公 告</font></div><div align="center">
<table class="formtable" cellspacing="1" cellpadding="0" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td class="formrow1" width="87" valign="middle">主题</td><td class="formrow2" width="504" colspan="3" valign="middle">
<input name="zt" value="" size=62>  <font color="#FF0000">*</font></td></tr>
return false;" href="">取 消</a> </td></tr></table>
</td></tr></table>
<input type="button" value="退回操作" style="display:none" name="btnReturn" onclick="return _doClick('482573F900304793.6cae365d160923be482573df0033310e/$Body/0.129C', this, null)">
<div class="title"><font face="宋体">电 子 公 告</font></div><div align="center">
<table class="formtable" cellspacing="1" cellpadding="0" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td class="formrow1" width="87" valign="middle">主题</td><td class="formrow2" width="504" colspan="3" valign="middle">
<input name="zt" value="" size=62>  <font color="#FF0000">*</font></td></tr>
采集后的html如下
<tr bgcolor="#e5efc1" height="20"><td> <a onclick="ToolOut()return false;" href="">取 消</a> </td></tr></table></td></tr></table><input type="button" value="退回操作" style="display:none" name="btnReturn" onclick="return _doClick('482573F900306D2A.b59f0170941c6d10482573df00332b83/$Body/0.129C', this, null)"><div class="title"><font face="宋体">公 司 通 知</font></div><div align="center"><table class="formtable" cellspacing="1" cellpadding="0" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td class="formrow1" width="87" valign="middle">主????题</td><td class="formrow2" width="504" colspan="3" valign="middle"><input name="zt" value="" size=62>  <font color="#FF0000">*</font></td></tr>
同一个页面,同样是全角空格,有些好的有些乱码