这是我的代码,目的是在滨州学院图书馆的新书通报中找有关鲁迅的书 用程序的到的结果是说暂时没有内容而在浏览器中却可以搜到很多书 ,这是怎么回事呢 ,请求熟悉的哥哥们赐教呀,十万火急呀!
public class Test2 { public static void main(String[] args) throws Exception {
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://10.9.10.3/museweb/xstb/xstb.asp");
List<NameValuePair> list = new ArrayList<NameValuePair>();
NameValuePair pair = new BasicNameValuePair("txtWxlx", "CN");
NameValuePair pair2 = new BasicNameValuePair("txtTm", "鲁迅");
list.add(pair);
list.add(pair2);
HttpEntity entity = new UrlEncodedFormEntity(list);
post.setEntity(entity);
HttpResponse response = client.execute(post);
String html =new String(EntityUtils.toByteArray(response.getEntity()));
System.out.println(html);
}
}
public class Test2 { public static void main(String[] args) throws Exception {
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://10.9.10.3/museweb/xstb/xstb.asp");
List<NameValuePair> list = new ArrayList<NameValuePair>();
NameValuePair pair = new BasicNameValuePair("txtWxlx", "CN");
NameValuePair pair2 = new BasicNameValuePair("txtTm", "鲁迅");
list.add(pair);
list.add(pair2);
HttpEntity entity = new UrlEncodedFormEntity(list);
post.setEntity(entity);
HttpResponse response = client.execute(post);
String html =new String(EntityUtils.toByteArray(response.getEntity()));
System.out.println(html);
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货