第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

2021年北京積分落戶名單公布了,爬了兩個(gè)多小時(shí)得到了所有數(shù)據(jù),有了驚人的發(fā)現(xiàn)(附源碼)

標(biāo)簽:
資訊

2021年北京积分落户名单公布了,手痒痒就写了一段Java代码,运行了两个多小时,终于到了所有数据,如下截图:

本着“Talk is cheap, Show me the code.”的原则,先看一下源码。

源码

落户实体类

先写一个落户实体类,便于储存和分析。

    @Setter
    @Getter
    static class Person {

        private int id;
        private String number;
        private String name;
        private int year;
        private int month;
        private String company;
        private double totalScore;
        private double[] detailScore;
    }

获取落户名单

获取落户名单的Ajax请求返回的居然是HTML,想法比较惊奇。直接写个正则表达式,提取想要的数据。

    private final static Pattern LIST_PATTERN = Pattern.compile(
            "<tr>[^<]*?<td[^>]*?>(\\S*?)</td>[^<]*?<td[^>]*?>(\\S*?)</td>[^<]*?<td[^>]*?>(\\d+)\\-(\\d+)</td>[^<]*?<td[^>]*?>(\\S*?)</td>[^<]*?<td[^>]*?>(\\S*?)</td>[^<]*?<td[^>]*?>[^<]*?<a[\\s\\S]*?onclick=\"showDetails\\('(\\d+)'\\)\">查看</a>[^<]*?</td>[^<]*?</tr>");

    private static List<Person> findPersonList() throws InterruptedException {
        String url = "http://fuwu.rsj.beijing.gov.cn/jf2021integralpublic/settlePerson/tablePage";
        List<Person> personList = new ArrayList<>();
        for (int page = 0; page <= 6040; page += 10) {
            Map<String, String> params = new HashMap<>();
            params.put("name", "");
            params.put("rows", "10");
            params.put("page", Integer.toString(page));
            String result = HttpUtils.doPost(url, params);
            Matcher matcher = LIST_PATTERN.matcher(result);
            while (matcher.find()) {
                Person person = new Person();
                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);
        }
        return personList;
    }

获取积分详情

积分详情的Ajax请求返回也是HTML,直接写10个正则表达式,提取想要的数据。

    private final static Pattern[] DETAIL_PATTERN_ARRAY = {
            Pattern.compile("合法稳定就业</td>[^<]*?<td[^>]*?>([\\d\\.\\-]+)"),
            Pattern.compile("合法稳定住所</td>[^<]*?<td[^>]*?>([\\d\\.\\-]+)"),
            Pattern.compile("教育背景</td>[^<]*?<td[^>]*?>([\\d\\.\\-]+)"),
            Pattern.compile("扣除取得学历(学位)期间累计的居住及就业分值</td>[^<]*?<td[^>]*?>([\\d\\.\\-]+)"),
            Pattern.compile("创新创业</td>[^<]*?<td[^>]*?>([\\d\\.\\-]+)"),
            Pattern.compile("职住区域</td>[^<]*?<td[^>]*?>([\\d\\.\\-]+)"),
            Pattern.compile("纳税</td>[^<]*?<td[^>]*?>([\\d\\.\\-]+)"),
            Pattern.compile("年龄</td>[^<]*?<td[^>]*?>([\\d\\.\\-]+)"),
            Pattern.compile("荣誉表彰</td>[^<]*?<td[^>]*?>([\\d\\.\\-]+)"),
            Pattern.compile("守法记录</td>[^<]*?<td[^>]*?>([\\d\\.\\-]+)"),
    };

    private static void enrichPersonList(List<Person> personList) throws InterruptedException {
        String url = "http://fuwu.rsj.beijing.gov.cn/jf2021integralpublic/settlePerson/settlePersonDetails";
        for (int i = 0; i < personList.size(); i++) {
            Person person = personList.get(i);
            Map<String, String> params = new HashMap<>();
            params.put("id", Integer.toString(person.getId()));
            String result = HttpUtils.doPost(url, params);
            double[] detailScore = new double[DETAIL_PATTERN_ARRAY.length];
            for (int j = 0; j < DETAIL_PATTERN_ARRAY.length; j++) {
                Matcher matcher = DETAIL_PATTERN_ARRAY[j].matcher(result);
                if (matcher.find()) {
                    detailScore[j] = Double.parseDouble(matcher.group(1));
                } else {
                    log.error("index: {}\n{}", j, result);
                }
            }
            person.setDetailScore(detailScore);
            log.info("person count: {} / {}", i, personList.size());
            Thread.sleep(1000);
        }
    }

现在已经有很多统计和分析,比如:年龄分布、公司排名,都已经烂大街了,一搜就能搜到,我们来看看不一样的。

有163人没上过大学,其中有19人年薪超过65万,占比11.65%;有5882人上了大学,其中有1476人年薪超过65万,占比25.09%。所以,要想获得更好的生活条件和境遇,需要更高的学历

名单数据

最后,感谢你的点赞推荐关注,帅气又美丽。

點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消