日期:2014-05-18  浏览次数:20781 次

Jsoup的问题。。


这样写 为什么提示错了啊,



代码贴出来了


public static String getStringNewHtmlPage(String username,String password) throws ClientProtocolExceptionIOException{
HttpClient httpClient = new DefaultHttpClient();
HttpGet httpget = new HttpGet("http://www.xx.com");
HttpResponse response = httpClient.execute(httpget);
httpget.releaseConnection();
HttpGet httpget1 = new HttpGet("http://www.xx.com");
HttpResponse response1 = httpClient.execute(httpget1);
HttpEntity he_1 = response1.getEntity();
String[] para = jsoupService.getParameterFromPage(EntityUtils.toString(he_1,"utf-8"));
String studentid =null;
String year = null;
String term = null;
if(para!=null){
studentid = para[0];
year = para[1];
term = para[2];
}
httpget1.releaseConnection();
HttpGet httpget2 = new HttpGet("http://www.xx.com");
HttpResponse response2 = httpClient.execute(httpget2);
HttpEntity he = response2.getEntity();
String pageStr = EntityUtils.toString(he,"utf-8");
httpget2.releaseConnection();
return pageStr;

}


ps:对Jsoup很是不熟悉,有啥好的资料推荐我一下呗。
Jsoup java

------解决方案--------------------
开启一个线程来抓取