读书人

Jsoup的有关问题。

发布时间: 2013-10-18 20:53:13 作者: rapoo

Jsoup的问题。。

Jsoup的有关问题。
这样写 为什么提示错了啊,

Jsoup的有关问题。

代码贴出来了



public static String getStringNewHtmlPage(String username,String password) throws ClientProtocolException, IOException{
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
[解决办法]
开启一个线程来抓取

读书人网 >J2EE开发

热点推荐