From a404c123e2efbad49402dc2b98bb84783c9069c3 Mon Sep 17 00:00:00 2001 From: Nyloner Date: Mon, 11 Jun 2018 10:29:45 +0800 Subject: [PATCH] update iservice --- iservice.10010.com/files/city.json | 886 +++++++++++++++++++++++++++++ iservice.10010.com/iservice.py | 19 +- 2 files changed, 899 insertions(+), 6 deletions(-) create mode 100644 iservice.10010.com/files/city.json diff --git a/iservice.10010.com/files/city.json b/iservice.10010.com/files/city.json new file mode 100644 index 0000000..85fffca --- /dev/null +++ b/iservice.10010.com/files/city.json @@ -0,0 +1,886 @@ +{ + "provinces": [ + ["00010001", "北京"], + ["00010003", "天津"], + ["00010025", "河北"], + ["00010018", "山西"], + ["00010029", "内蒙古"], + ["00010011", "辽宁"], + ["00010012", "吉林"], + ["00010013", "黑龙江"], + ["00010002", "上海"], + ["00010008", "江苏"], + ["00010007", "浙江"], + ["00010019", "安徽"], + ["00010006", "福建"], + ["00010022", "江西"], + ["00010016", "山东"], + ["00010023", "河南"], + ["00010024", "湖北"], + ["00010017", "湖南"], + ["00010004", "广东"], + ["00010014", "广西"], + ["00010005", "海南"], + ["00010010", "重庆"], + ["00010009", "四川"], + ["00010027", "贵州"], + ["00010026", "云南"], + ["00010032", "西藏"], + ["00010015", "陕西"], + ["00010030", "甘肃"], + ["00010020", "青海"], + ["00010028", "宁夏"], + ["00010021", "新疆"] + ], + + "procitys": [ + [ + ["100010001", "北京市"] + ], + [ + ["100030001", "天津市"] + ], + [ + ["100250001", "石家庄市"], + ["100250004", "唐山市"], + ["100250005", "秦皇岛市"], + ["100250011", "邯郸市"], + ["100250010", "邢台市"], + ["100250002", "保定市"], + ["100250009", "张家口市"], + ["100250003", "承德市"], + ["100250006", "廊坊市"], + ["100250007", "沧州市"], + ["100250008", "衡水市"] + ], + [ + ["100180003", "太原市"], + ["100180004", "大同市"], + ["100180005", "阳泉市"], + ["100180001", "朔州市"], + ["100180002", "忻州市"], + ["100180006", "晋中市"], + ["100180010", "吕梁市"], + ["100180007", "长治市"], + ["100180008", "晋城市"], + ["100180009", "临汾市"], + ["100180011", "运城"] + ], + [ + ["100290007", "呼和浩特市"], + ["100290008", "包头市"], + ["100290011", "乌海市"], + ["100290004", "赤峰市"], + ["100290001", "呼伦贝尔市"], + ["100290002", "兴安盟"], + ["100290003", "通辽市"], + ["100290005", "锡林郭勒盟"], + ["100290006", "乌兰察布市"], + ["100290010", "鄂尔多斯市"], + ["100290009", "巴彦淖尔市"], + ["100290012", "阿拉善盟"] + ], + [ + ["100110001", "沈阳市"], + ["100110002", "大连市"], + ["100110003", "鞍山市"], + ["100110004", "抚顺市"], + ["100110005", "本溪市"], + ["100110006", "丹东市"], + ["100110007", "锦州市"], + ["100110008", "营口市"], + ["100110009", "阜新市"], + ["100110010", "辽阳市"], + ["100110011", "铁岭市"], + ["100110012", "朝阳市"], + ["100110013", "盘锦市"], + ["100110014", "葫芦岛市"] + ], + [ + ["100120001", "长春市"], + ["100120002", "吉林市"], + ["100120008", "延边朝鲜族自治州"], + ["100120005", "四平市"], + ["100120009", "通化市"], + ["100120007", "白城市"], + ["100120004", "辽源市"], + ["100120003", "松原市"], + ["100120006", "白山市"] + ], + [ + ["100130001", "哈尔滨市"], + ["100130002", "齐齐哈尔市"], + ["100130003", "牡丹江市"], + ["100130004", "佳木斯市"], + ["100130010", "绥化市"], + ["100130005", "大庆市"], + ["100130008", "鸡西市"], + ["100130011", "黑河市"], + ["100130012", "伊春市"], + ["100130006", "双鸭山市"], + ["100130007", "鹤岗市"], + ["100130009", "七台河市"], + ["100130013", "大兴安岭地区"] + ], + [ + ["100020001", "上海"] + ], + [ + ["100080001", "南京市"], + ["100080013", "苏州市"], + ["100080012", "无锡市"], + ["100080011", "常州市"], + ["100080008", "扬州市"], + ["100080010", "镇江市"], + ["100080007", "南通市"], + ["100080002", "徐州市"], + ["100080009", "泰州市"], + ["100080006", "盐城市"], + ["100080004", "淮安市"], + ["100080003", "连云港"], + ["100080005", "宿迁市"] + ], + [ + ["100070002", "杭州市"], + ["100070004", "温州市"], + ["100070011", "衢州市"], + ["100070006", "湖州市"], + ["100070007", "嘉兴市"], + ["100070008", "绍兴市"], + ["100070005", "台州市"], + ["100070001", "丽水市"], + ["100070009", "金华市"], + ["100070010", "舟山市"], + ["100070003", "宁波市"] + ], + [ + ["100190007", "安庆市"], + ["100190003", "蚌埠市"], + ["100190010", "亳州市"], + ["100190016", "巢湖市"], + ["100190017", "池州市"], + ["100190001", "滁州市"], + ["100190009", "阜阳市"], + ["100190002", "合肥市"], + ["100190012", "淮北市"], + ["100190005", "淮南市"], + ["100190011", "黄山市"], + ["100190015", "六安市"], + ["100190006", "马鞍山市"], + ["100190008", "宿州市"], + ["100190013", "铜陵市"], + ["100190004", "芜湖市"], + ["100190014", "宣城市"] + ], + [ + ["100060001", "福州市"], + ["100060002", "厦门市"], + ["100060005", "泉州市"], + ["100060006", "漳州市"], + ["100060003", "宁德市"], + ["100060004", "莆田市"], + ["100060009", "南平市"], + ["100060008", "三明市"], + ["100060007", "龙岩市"] + ], + [ + ["100220001", "南昌"], + ["100220002", "九江"], + ["100220004", "上饶"], + ["100220005", "宜春"], + ["100220007", "赣州"], + ["100220003", "抚州"], + ["100220010", "新余"], + ["100220006", "吉安"], + ["100220008", "景德镇"], + ["100220011", "鹰潭"], + ["100220009", "萍乡"] + ], + [ + ["100160002", "济南市"], + ["100160003", "青岛市"], + ["100160004", "淄博市"], + ["100160014", "枣庄市"], + ["100160012", "东营市"], + ["100160006", "烟台市"], + ["100160007", "潍坊市"], + ["100160008", "济宁市"], + ["100160009", "泰安市"], + ["100160013", "威海市"], + ["100160015", "日照市"], + ["100160016", "莱芜市"], + ["100160010", "临沂市"], + ["100160005", "德州市"], + ["100160017", "聊城市"], + ["100160011", "滨州市"], + ["100160001", "菏泽市"] + ], + [ + ["100230001", "郑州市"], + ["100230004", "洛阳市"], + ["100230011", "开封市"], + ["100230010", "新乡市"], + ["100230003", "许昌市"], + ["100230013", "漯河市"], + ["100230008", "安阳市"], + ["100230015", "商丘市"], + ["100230006", "周口市"], + ["100230012", "驻马店市"], + ["100230017", "鹤壁市"], + ["100230007", "信阳市"], + ["100230014", "南阳市"], + ["100230002", "三门峡市"], + ["100230016", "濮阳市"], + ["100230009", "焦作市"], + ["100230005", "平顶山市"], + ["100230022", "济源市"] + ], + [ + ["100240001", "武汉"], + ["100240008", "宜昌"], + ["100240003", "荆州"], + ["100240004", "黄冈"], + ["100240002", "黄石"], + ["100240005", "襄阳"], + ["100240007", "孝感"], + ["100240010", "鄂州"], + ["100240011", "咸宁"], + ["100240009", "十堰"], + ["100240012", "随州"], + ["100240006", "荆门"], + ["100240013", "恩施"], + ["100240024", "仙桃"], + ["100240020", "潜江"], + ["100240022", "天门"], + ["100240014", "神农架"] + ], + [ + ["100170002", "长沙市"], + ["100170004", "株洲市"], + ["100170003", "湘潭市"], + ["100170005", "衡阳市"], + ["100170001", "岳阳市"], + ["100170008", "益阳市"], + ["100170006", "郴州市"], + ["100170007", "常德市"], + ["100170009", "娄底市"], + ["100170010", "邵阳市"], + ["100170012", "张家界市"], + ["100170013", "怀化市"], + ["100170014", "永州市"], + ["100170011", "湘西自治州"] + ], + [ + ["100040001", "广州市"], + ["100040002", "深圳市"], + ["100040003", "珠海市"], + ["100040009", "汕头市"], + ["100040020", "韶关市"], + ["100040016", "河源市"], + ["100040011", "梅州市"], + ["100040015", "惠州市"], + ["100040010", "汕尾市"], + ["100040006", "东莞市"], + ["100040004", "中山市"], + ["100040017", "江门市"], + ["100040005", "佛山市"], + ["100040008", "阳江市"], + ["100040012", "湛江市"], + ["100040018", "茂名市"], + ["100040007", "肇庆市"], + ["100040013", "清远市"], + ["100040014", "潮州市"], + ["100040019", "揭阳市"], + ["100040021", "云浮市"] + ], + [ + ["100140002", "南宁市"], + ["100140004", "柳州市"], + ["100140006", "桂林市"], + ["100140007", "梧州市"], + ["100140009", "玉林市"], + ["100140011", "百色市"], + ["100140012", "钦州市"], + ["100140013", "河池市"], + ["100140014", "北海市"], + ["100140001", "防城港市"], + ["100140010", "贵港市"], + ["100140008", "贺州市"], + ["100140015", "崇左市"], + ["100140005", "来宾市"] + ], + [ + ["100050001", "海口"], + ["100050002", "三亚"], + ["100050003", "琼海市"], + ["100050004", "儋州市"], + ["100050005", "文昌市"], + ["100050006", "东方市"], + ["100050007", "五指山市"], + ["100050008", "万宁市"], + ["100050009", "定安县"], + ["100050019", "屯昌县"], + ["100050011", "澄迈县"], + ["100050012", "临高县"], + ["100050013", "陵水县"], + ["100050014", "琼中县"], + ["100050015", "保亭县"], + ["100050016", "乐东县"], + ["100050017", "昌江县"], + ["100050018", "白沙县"] + ], + [ + ["100100001", "重庆市"] + ], + [ + ["100090001", "成都市"], + ["100090013", "攀枝花市"], + ["100090015", "泸州市"], + ["100090007", "德阳市"], + ["100090005", "绵阳市"], + ["100090023", "广元市"], + ["100090008", "遂宁市"], + ["100090010", "内江市"], + ["100090012", "乐山市"], + ["100090003", "南充市"], + ["100090006", "宜宾市"], + ["100090002", "广安市"], + ["100090009", "达州市"], + ["100090017", "巴中市"], + ["100090016", "雅安市"], + ["100090014", "眉山市"], + ["100090022", "资阳市"], + ["100090018", "自贡市"], + ["100090021", "阿坝藏族羌族自治州"], + ["100090004", "凉山彝族自治州"], + ["100090019", "甘孜藏族自治州"] + ], + [ + ["100270005", "贵阳"], + ["100270001", "遵义市"], + ["100270002", "毕节市"], + ["100270010", "六盘水"], + ["100270007", "黔南州"], + ["100270008", "黔东南州"], + ["100270006", "安顺市"], + ["100270009", "黔西南州"], + ["100270003", "铜仁地区"] + ], + [ + ["100260007", "大理白族自治州"], + ["100260009", "红河哈尼族彝族自治州"], + ["100260001", "昆明市"], + ["100260010", "丽江市"], + ["100260003", "曲靖市"], + ["100260002", "西双版纳傣族自治州"], + ["100260008", "玉溪市"], + ["100260006", "楚雄彝族自治州"], + ["100260005", "昭通市"], + ["100260015", "普洱市"], + ["100260004", "保山市"], + ["100260016", "文山壮族苗族自治州"], + ["100260012", "临沧市"], + ["100260014", "德宏傣族景颇族自治州"], + ["100260017", "迪庆藏族自治州"], + ["100260013", "怒江傈僳族自治州"] + ], + [ + ["100320003", "拉萨"], + ["100320006", "日喀则"], + ["100320007", "山南"], + ["100320004", "林芝"], + ["100320005", "那曲"], + ["100320002", "昌都"], + ["100320001", "阿里"] + ], + [ + ["100150002", "西安市"], + ["100150001", "咸阳市"], + ["100150005", "渭南市"], + ["100150009", "宝鸡市"], + ["100150008", "汉中市"], + ["100150003", "延安市"], + ["100150004", "榆林市"], + ["100150010", "铜川市"], + ["100150007", "安康市"], + ["100150006", "商洛市"] + ], + [ + ["100300001", "兰州市"], + ["100300002", "嘉峪关市"], + ["100300011", "酒泉市"], + ["100300008", "白银市"], + ["100300006", "庆阳市"], + ["100300007", "天水市"], + ["100300005", "平凉市"], + ["100300004", "定西市"], + ["100300009", "临夏回族自治州"], + ["100300013", "陇南市"], + ["100300014", "甘南藏族自治州"], + ["100300010", "张掖市"], + ["100300003", "武威市"], + ["100300012", "金昌市"] + ], + [ + ["100200002", "西宁市"], + ["100200003", "海东地区"], + ["100200004", "黄南藏族自治州"], + ["100200009", "格尔木市"], + ["100200008", "海西蒙古族藏族自治州"], + ["100200001", "海北藏族自治州"], + ["100200005", "海南藏族自治州"], + ["100200007", "玉树藏族自治州"], + ["100200006", "果洛藏族自治州"] + ], + [ + ["100280001", "银川市"], + ["100280003", "吴忠市"], + ["100280002", "石嘴山市"], + ["100280005", "中卫市"], + ["100280004", "固原市"] + ], + [ + ["100210008", "乌鲁木齐市"], + ["100210010", "昌吉回族自治州"], + ["100210004", "阿勒泰地区"], + ["100210016", "喀什地区"], + ["100210009", "石河子市"], + ["100210018", "伊犁哈萨克自治州"], + ["100210007", "克拉玛依市"], + ["100210013", "巴音郭楞蒙古自治州"], + ["100210014", "阿克苏地区"], + ["100210002", "哈密地区"], + ["100210012", "吐鲁番地区"], + ["100210019", "奎屯市"], + ["100210006", "博尔塔拉蒙古自治州"], + ["100210001", "塔城地区"], + ["100210003", "和田地区"], + ["100210005", "克孜勒苏柯尔克孜自治州"] + ] + ], + "citys": [ + [ + ["110", "北京市"] + ], + [ + ["130", "天津市"] + ], + [ + ["188", "石家庄市"], + ["181", "唐山市"], + ["182", "秦皇岛市"], + ["186", "邯郸市"], + ["185", "邢台市"], + ["187", "保定市"], + ["184", "张家口市"], + ["189", "承德市"], + ["183", "廊坊市"], + ["180", "沧州市"], + ["720", "衡水市"] + ], + [ + ["190", "太原市"], + ["193", "大同市"], + ["192", "阳泉市"], + ["199", "朔州市"], + ["198", "忻州市"], + ["191", "晋中市"], + ["200", "吕梁市"], + ["195", "长治市"], + ["194", "晋城市"], + ["197", "临汾市"], + ["196", "运城"] + ], + [ + ["101", "呼和浩特市"], + ["102", "包头市"], + ["106", "乌海市"], + ["107", "赤峰市"], + ["108", "呼伦贝尔市"], + ["113", "兴安盟"], + ["109", "通辽市"], + ["111", "锡林郭勒盟"], + ["103", "乌兰察布市"], + ["104", "鄂尔多斯市"], + ["105", "巴彦淖尔市"], + ["114", "阿拉善盟"] + ], + [ + ["910", "沈阳市"], + ["940", "大连市"], + ["912", "鞍山市"], + ["913", "抚顺市"], + ["914", "本溪市"], + ["915", "丹东市"], + ["916", "锦州市"], + ["917", "营口市"], + ["918", "阜新市"], + ["919", "辽阳市"], + ["911", "铁岭市"], + ["920", "朝阳市"], + ["921", "盘锦市"], + ["922", "葫芦岛市"] + ], + [ + ["901", "长春市"], + ["902", "吉林市"], + ["909", "延边朝鲜族自治州"], + ["903", "四平市"], + ["905", "通化市"], + ["907", "白城市"], + ["906", "辽源市"], + ["904", "松原市"], + ["908", "白山市"] + ], + [ + ["971", "哈尔滨市"], + ["973", "齐齐哈尔市"], + ["988", "牡丹江市"], + ["976", "佳木斯市"], + ["989", "绥化市"], + ["981", "大庆市"], + ["991", "鸡西市"], + ["990", "黑河市"], + ["996", "伊春市"], + ["994", "双鸭山市"], + ["993", "鹤岗市"], + ["992", "七台河市"], + ["995", "大兴安岭地区"] + ], + [ + ["310", "上海"] + ], + [ + ["340", "南京市"], + ["450", "苏州市"], + ["330", "无锡市"], + ["440", "常州市"], + ["430", "扬州市"], + ["343", "镇江市"], + ["358", "南通市"], + ["350", "徐州市"], + ["445", "泰州市"], + ["348", "盐城市"], + ["354", "淮安市"], + ["346", "连云港"], + ["349", "宿迁市"] + ], + [ + ["360", "杭州市"], + ["470", "温州市"], + ["468", "衢州市"], + ["362", "湖州市"], + ["363", "嘉兴市"], + ["365", "绍兴市"], + ["476", "台州市"], + ["469", "丽水市"], + ["367", "金华市"], + ["364", "舟山市"], + ["370", "宁波市"] + ], + [ + ["302", "安庆市"], + ["301", "蚌埠市"], + ["318", "亳州市"], + ["309", "巢湖市"], + ["317", "池州市"], + ["312", "滁州市"], + ["306", "阜阳市"], + ["305", "合肥市"], + ["314", "淮北市"], + ["307", "淮南市"], + ["316", "黄山市"], + ["304", "六安市"], + ["300", "马鞍山市"], + ["313", "宿州市"], + ["308", "铜陵市"], + ["303", "芜湖市"], + ["311", "宣城市"] + ], + [ + ["380", "福州市"], + ["390", "厦门市"], + ["480", "泉州市"], + ["395", "漳州市"], + ["386", "宁德市"], + ["385", "莆田市"], + ["387", "南平市"], + ["389", "三明市"], + ["384", "龙岩市"] + ], + [ + ["750", "南昌"], + ["755", "九江"], + ["757", "上饶"], + ["756", "宜春"], + ["752", "赣州"], + ["759", "抚州"], + ["753", "新余"], + ["751", "吉安"], + ["740", "景德镇"], + ["754", "鹰潭"], + ["758", "萍乡"] + ], + [ + ["170", "济南市"], + ["166", "青岛市"], + ["150", "淄博市"], + ["157", "枣庄市"], + ["156", "东营市"], + ["161", "烟台市"], + ["155", "潍坊市"], + ["158", "济宁市"], + ["172", "泰安市"], + ["152", "威海市"], + ["154", "日照市"], + ["160", "莱芜市"], + ["153", "临沂市"], + ["173", "德州市"], + ["174", "聊城市"], + ["151", "滨州市"], + ["159", "菏泽市"] + ], + [ + ["760", "郑州市"], + ["761", "洛阳市"], + ["762", "开封市"], + ["764", "新乡市"], + ["765", "许昌市"], + ["766", "漯河市"], + ["767", "安阳市"], + ["768", "商丘市"], + ["770", "周口市"], + ["771", "驻马店市"], + ["774", "鹤壁市"], + ["776", "信阳市"], + ["777", "南阳市"], + ["772", "三门峡市"], + ["773", "濮阳市"], + ["763", "焦作市"], + ["769", "平顶山市"], + ["775", "济源市"] + ], + [ + ["710", "武汉"], + ["711", "宜昌"], + ["712", "荆州"], + ["714", "黄冈"], + ["715", "黄石"], + ["716", "襄阳"], + ["717", "孝感"], + ["718", "鄂州"], + ["719", "咸宁"], + ["721", "十堰"], + ["723", "随州"], + ["724", "荆门"], + ["727", "恩施"], + ["713", "仙桃"], + ["726", "潜江"], + ["725", "天门"], + ["722", "神农架"] + ], + [ + ["741", "长沙市"], + ["742", "株洲市"], + ["743", "湘潭市"], + ["744", "衡阳市"], + ["745", "岳阳市"], + ["747", "益阳市"], + ["748", "郴州市"], + ["749", "常德市"], + ["791", "娄底市"], + ["792", "邵阳市"], + ["794", "张家界市"], + ["795", "怀化市"], + ["796", "永州市"], + ["793", "湘西自治州"] + ], + [ + ["510", "广州市"], + ["540", "深圳市"], + ["620", "珠海市"], + ["560", "汕头市"], + ["558", "韶关市"], + ["670", "河源市"], + ["528", "梅州市"], + ["570", "惠州市"], + ["525", "汕尾市"], + ["580", "东莞市"], + ["556", "中山市"], + ["550", "江门市"], + ["530", "佛山市"], + ["565", "阳江市"], + ["520", "湛江市"], + ["568", "茂名市"], + ["536", "肇庆市"], + ["535", "清远市"], + ["531", "潮州市"], + ["526", "揭阳市"], + ["538", "云浮市"] + ], + [ + ["591", "南宁市"], + ["593", "柳州市"], + ["592", "桂林市"], + ["594", "梧州市"], + ["595", "玉林市"], + ["596", "百色市"], + ["597", "钦州市"], + ["598", "河池市"], + ["599", "北海市"], + ["590", "防城港市"], + ["589", "贵港市"], + ["588", "贺州市"], + ["600", "崇左市"], + ["601", "来宾市"] + ], + [ + ["501", "海口"], + ["502", "三亚"], + ["504", "琼海市"], + ["503", "儋州市"], + ["505", "文昌市"], + ["506", "东方市"], + ["507", "五指山市"], + ["508", "万宁市"], + ["509", "定安县"], + ["519", "屯昌县"], + ["511", "澄迈县"], + ["512", "临高县"], + ["513", "陵水县"], + ["514", "琼中县"], + ["515", "保亭县"], + ["516", "乐东县"], + ["517", "昌江县"], + ["518", "白沙县"] + ], + [ + ["831", "重庆市"] + ], + [ + ["810", "成都市"], + ["813", "攀枝花市"], + ["815", "泸州市"], + ["825", "德阳市"], + ["824", "绵阳市"], + ["826", "广元市"], + ["821", "遂宁市"], + ["816", "内江市"], + ["814", "乐山市"], + ["822", "南充市"], + ["817", "宜宾市"], + ["823", "广安市"], + ["820", "达州市"], + ["827", "巴中市"], + ["811", "雅安市"], + ["819", "眉山市"], + ["830", "资阳市"], + ["818", "自贡市"], + ["829", "阿坝藏族羌族自治州"], + ["812", "凉山彝族自治州"], + ["828", "甘孜藏族自治州"] + ], + [ + ["850", "贵阳"], + ["787", "遵义市"], + ["851", "毕节市"], + ["853", "六盘水"], + ["788", "黔南州"], + ["786", "黔东南州"], + ["789", "安顺市"], + ["852", "黔西南州"], + ["785", "铜仁地区"] + ], + [ + ["862", "大理白族自治州"], + ["861", "红河哈尼族彝族自治州"], + ["860", "昆明市"], + ["863", "丽江市"], + ["866", "曲靖市"], + ["736", "西双版纳傣族自治州"], + ["865", "玉溪市"], + ["864", "楚雄彝族自治州"], + ["867", "昭通市"], + ["869", "普洱市"], + ["731", "保山市"], + ["732", "文山壮族苗族自治州"], + ["733", "临沧市"], + ["730", "德宏傣族景颇族自治州"], + ["735", "迪庆藏族自治州"], + ["734", "怒江傈僳族自治州"] + ], + [ + ["790", "拉萨"], + ["797", "日喀则"], + ["798", "山南"], + ["799", "林芝"], + ["801", "那曲"], + ["800", "昌都"], + ["802", "阿里"] + ], + [ + ["841", "西安市"], + ["844", "咸阳市"], + ["843", "渭南市"], + ["840", "宝鸡市"], + ["849", "汉中市"], + ["842", "延安市"], + ["845", "榆林市"], + ["846", "铜川市"], + ["848", "安康市"], + ["847", "商洛市"] + ], + [ + ["870", "兰州市"], + ["876", "嘉峪关市"], + ["931", "酒泉市"], + ["879", "白银市"], + ["873", "庆阳市"], + ["877", "天水市"], + ["872", "平凉市"], + ["871", "定西市"], + ["878", "临夏回族自治州"], + ["960", "陇南市"], + ["961", "甘南藏族自治州"], + ["875", "张掖市"], + ["874", "武威市"], + ["930", "金昌市"] + ], + [ + ["700", "西宁市"], + ["701", "海东地区"], + ["707", "黄南藏族自治州"], + ["702", "格尔木市"], + ["704", "海西蒙古族藏族自治州"], + ["706", "海北藏族自治州"], + ["705", "海南藏族自治州"], + ["709", "玉树藏族自治州"], + ["708", "果洛藏族自治州"] + ], + [ + ["880", "银川市"], + ["883", "吴忠市"], + ["884", "石嘴山市"], + ["886", "中卫市"], + ["885", "固原市"] + ], + [ + ["890", "乌鲁木齐市"], + ["891", "昌吉回族自治州"], + ["953", "阿勒泰地区"], + ["897", "喀什地区"], + ["893", "石河子市"], + ["898", "伊犁哈萨克自治州"], + ["899", "克拉玛依市"], + ["895", "巴音郭楞蒙古自治州"], + ["896", "阿克苏地区"], + ["900", "哈密地区"], + ["894", "吐鲁番地区"], + ["892", "奎屯市"], + ["951", "博尔塔拉蒙古自治州"], + ["952", "塔城地区"], + ["955", "和田地区"], + ["954", "克孜勒苏柯尔克孜自治州"] + ] + ] +} \ No newline at end of file diff --git a/iservice.10010.com/iservice.py b/iservice.10010.com/iservice.py index 2369a88..1d2fc48 100644 --- a/iservice.10010.com/iservice.py +++ b/iservice.10010.com/iservice.py @@ -14,7 +14,8 @@ def get_city_hall(province_code, city_code): url = 'http://iservice.10010.com/e3/static/life/listHallByPropertyNew?provinceCode={}&cityCode={}&page={}' page = 1 result = [] - keys = ['epProvincename', 'epCityname', 'epName', 'epAddress'] + keys = ['epProvincename', 'epCityname', 'epName', + 'epAddress', 'epLinkTelphone', 'epBusinessTime'] while True: req = build_request(url.format(province_code, city_code, page)) res_data = req.json() @@ -27,7 +28,10 @@ def get_city_hall(province_code, city_code): for hall in hall_list: line = [] for key in keys: - line.append(hall[key]) + try: + line.append(hall[key]) + except: + line.append('') result.append(line) print(current_time(), province_code, city_code, page, 'OK') page += 1 @@ -47,8 +51,9 @@ def crawl_hall(): try: result = get_city_hall(province_code, city_code) except: - f=open('./files/fail','a') - f.write(json.dumps(provinces[index]+city,ensure_ascii=False)+'\n') + f = open('./files/fail', 'a') + f.write(json.dumps( + provinces[index]+city, ensure_ascii=False)+'\n') f.close() continue f = open('./files/result', 'a') @@ -56,6 +61,8 @@ def crawl_hall(): f.write(json.dumps( [province_name, city_name]+hall, ensure_ascii=False)+'\n') f.close() - print(current_time(),province_name,city_name,'OK') + print(current_time(), province_name, city_name, 'OK') + -write_to_excel(load_txt('./files/result'),'联通营业厅数据.xlsx') \ No newline at end of file +crawl_hall() +write_to_excel(load_txt('./files/result'), '联通营业厅数据.xlsx')