Commit f0ddce27 by zhiwei

添加翻页功能

parent 5f4ff8d3
...@@ -64,6 +64,29 @@ public class BaiduTiebaCrawlerParse extends HttpClientTemplateOK { ...@@ -64,6 +64,29 @@ public class BaiduTiebaCrawlerParse extends HttpClientTemplateOK {
return list; return list;
} }
/**
* 获取每页数据
* @Title: getBaiduTiebaData
* @author hero
* @param @param word
* @param @param proxy
* @param @param tiebaName
* @param @param page
* @param @return
* @param @throws Exception 设定文件
* @return Map<String,Object> 返回类型
*/
public static Map<String,Object> getBaiduTiebaData(String word, Proxy proxy, String tiebaName,int page) throws Exception {
String htmlBody = downloadHtml(word, proxy, tiebaName, page);
if (htmlBody != null) {
return analysisData(htmlBody, proxy, word);
}
return null;
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static List<TiebaData> getBaiduTiebaAnswerDataByUrl(String url, Proxy proxy) throws Exception { public static List<TiebaData> getBaiduTiebaAnswerDataByUrl(String url, Proxy proxy) throws Exception {
List<TiebaData> list = new ArrayList<TiebaData>(); List<TiebaData> list = new ArrayList<TiebaData>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment