pip install phone
from phone import phone
p = phone()
def get_pc(ss):
# s : '13565656565'
# get provice and city
try:
res = p.find(ss)
if res:
prov = res.get('province')
cit = res.get('city')
return prov, cit
else:
return '0', '0'
except:
return '0', '0
返回省市區的字典,切割不出來會把相應value設為』0』
pip install cpca-fix
from cpca import transform as transaddr
defsplit_address
(addr)
:# 比如寶山區,全國有很多個,無法知道究竟是哪個,請根據情況自定義下面的map
myumap =
try:
address =
result = transaddr(address, cut=
false
, umap=myumap)
province =
list
(result.get(
'省'))[
0]city =
list
(result.get(
'市'))[
0]area =
list
(result.get(
'區'))[
獲取手機號歸屬地
如下 test public void tt catch interruptedexception e finally public void get string v phone finally catch clientprotocolexception e catch parseexceptio...
java手機號歸屬地查詢
物件 public class phonemodel 省份名稱 param provincename 設定 provincename 屬性值為引數值 provincename public void setprovincename string provincename 城市名稱 return 獲取...
查詢手機歸屬地
手機號碼 replace 手機號碼 i 0 trim strcont.substring 0,strcont.indexof replace strcont strcont.remove 0,strcont.indexof 所屬省份 replace 所屬省份 i 1 trim strcont.sub...