JAVA爬虫爬取天猫某一个手机所有数据(包括品牌型号价格评论参数都要有)

要MyEclipse版本的,最好有讲解就最好了,我们老师让我们弄懂。。。周一提问啊。。。。

第1个回答  2014-12-19
HttpClient client = new HttpClient();
HttpMethod method = new PostMethod(indexUrl);
client.executeMethod(method);
method = new PostMethod("http://要抓取的地址");
client.executeMethod(method);
// 返回的信息
// 程序运行到这里时,就读取了索引页的源代码,然后去除空白的换行
String letterContent = method.getResponseBodyAsString().replaceAll("\r\n", "");
// 这个方法是去解析这一页内容的
// 这里是默认执行的第一页.
handleFirstIndex(client, method, letterContent,indexUrl);
// 释放连接
method.releaseConnection();本回答被提问者和网友采纳
相似回答