Jsoup的问题。。

你个神经病 2013-10-11 01:48:07


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



代码贴出来了


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很是不熟悉,有啥好的资料推荐我一下呗。
...全文
172 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yxingkong 2013-10-11
  • 打赏
  • 举报
回复
wang7535067 2013-10-11
  • 打赏
  • 举报
回复
开启一个线程来抓取
tony4geek 2013-10-11
  • 打赏
  • 举报
回复
会不会超时呢。你换个网站抓取下试试呢
你个神经病 2013-10-11
  • 打赏
  • 举报
回复
没人解决一下吗?

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧