上海链家二手房挂牌数量脚本

获取上海链家二手房挂牌数量的脚本

const https = require('https');
https.get('https://map.ke.com/proxyApi/i.c-pc-webapi.ke.com/map/bubblelist?cityId=310000&dataSource=ESF&condition=&id=&groupType=district&maxLatitude=31.681833328321947&minLatitude=31.317290433641848&maxLongitude=122.22462814890648&minLongitude=120.51482937343484',(res)=>{
    let data = ''
    res.on('data',(chunk)=>{
        data += chunk;
    })
    res.on('end',()=>{
        let bubbleList = JSON.parse(data)['data']['bubbleList'];
        let count = 0;
        for(value in bubbleList){
            count = count + bubbleList[value]['count'];
        }
         console.log("total === " + count);
    })
})
/**
 * 获取链家上海二手房挂牌数量的脚本
 * 由于用到了 https,所以第一次使用的时候需要先执行 npm install https --save 进行安装 https
 * 安装完 https 后,就可以在 house.js 文件所在的目录执行 node house.js 运行脚本
 */
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容