private int getPageNum() { setCurrentPage(1); Document doc = WebScrappUtil.post(url, argMap); Elements aa = doc.select("p[class=page_info]"); String[] pageString = aa.text().split("]"); logger.info("aa:{}", aa.text()); int indexname = pageString[0].lastIndexOf("/"); String pageNum = pageString[0].substring(indexname + 1, pageString[0].length()); return Integer.valueOf(pageNum); }
public Set<DartCompany> getDartCompanySet(int pageIndex) { Set<DartCompany> rst = new HashSet<DartCompany>(); setCurrentPage(pageIndex); Document doc = WebScrappUtil.get(url, argMap); Elements elements = doc.select("div[class =table_scroll]>table>tbody>tr"); rst = writeDartCompanyEntity(elements); logger.info("DartCompanySize : {} ", rst.size()); for (DartCompany comp : rst) { comp.setPageNum(pageIndex); } return rst; }