params=newHashMap<>();params.put("姓名","");params.put("rows","10");params.put("page",Integer.toString(page));Stringresult=HttpUtils.doPost(url,params);Matchermatcher=LIST_PATTERN.matcher(result);while(matcher.find()){Personperson=newPerson();person.setNumber(matcher.group(1));person.setName(matcher.group(2));person.setYear(Integer.parseInt(matcher.group(3))));person.setMonth(Integer.parseInt(matcher.group(4)));person.setCompany(matcher.group(5));person.setTotalScore(Double.parseDouble(matcher.group(6)));person.setId(Integer.parseInt(matcher.group(7)));personList.add(person);}log.info("page:{}",page);Thread.sleep(1000);}returnpersonList;}获取积分详情Ajax请求返回积分详情也是HTML,直接写10个正则表达式提取想要的数据privatefinalstaticPattern[]DETAIL_PATTERN_ARRAY={Pattern.compile("合法稳定就业[^<]*?]*?>([\\d\\.\\-]+)"),Pattern.compile("合法稳定住所 | [^<]*?]*?>([\\d\\.\\-]+)"),Pattern.compile("学历 | [^<]*?]*?>([\\d\\.\\-]+)"),Pattern.compile("学历推导(学位)累计居住和就业积分 | [^<]*?]*?>([\\d\\.\\-]+)"),Pattern.compile("创新与创业 | [^<]*?]*?>([\\d\\.\\-]+)"),Pattern.compile("工作居住区 | [^<]*?]*?>([\\d\\.\\-]+)"),Pattern.compile("tax | [^<]*?]*?>([\\d\\.\\-]+)"),Pattern.compile("年龄 | [^<]*?]*?>([\\d\\.\\-]+)"),Pattern.compile("嘉奖 | [^<]*?]*?>([\\d\\.\\-]+)"),Pattern.compile("守法记录 | [^<]*?]*?>([\\d\\.\\-]+)"),};privatestaticvoidenrichPersonList(ListpersonList)throwsInterruptedException{Stringurl="http://fuwu.rsj.beijing.gov.cn/jf2021integralpublic/settlePerson/settlePersonDetails";for(inti=0;iparams=newHashMap<>();params.put("id",Integer.toString(person.getId()));Stringresult=HttpUtils.doPost(url,params);double[]detailScore=newdouble[DETAIL_PATTERN_ARRAY.length];for(intj=0;j
|