标签:name tps cat https 运营 eva 输入 blog dict
1 #encoding:utf-8 2 #Python 3.4.3 3 import urllib 4 import requests 5 phone=input(‘输入一个手机号码:‘) 6 url=‘https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=%s‘ % phone 7 data=urllib.request.urlopen(url).read().decode(‘gbk‘) 8 dict=eval(data.replace(‘__GetZoneResult_ =‘,‘‘).replace(‘\r\n‘,‘‘).replace(‘ ‘,"‘").replace(‘\t‘,"‘").replace(‘:‘,"‘:")) 9 print(‘省份: ‘,dict.get(‘province‘)) 10 print(‘运营商: ‘,dict.get(‘catName‘)) 11 print(‘号码: ‘,dict.get(‘telString‘))
标签:name tps cat https 运营 eva 输入 blog dict
原文地址:http://www.cnblogs.com/stay-hungry/p/6950622.html