技术 |
文件夹字数统计的大概原理 | 词条盖子 |
北京,http://map.amap.com/service/subway?_1678441427760&srhdata=1100_drw_beijing.json
上海,http://map.amap.com/service/subway?_1678441513252&srhdata=3100_drw_shanghai.json
广州,http://map.amap.com/service/subway?_1678441586823&srhdata=4401_drw_guangzhou.json
深圳,http://map.amap.com/service/subway?_1678441596574&srhdata=4403_drw_shenzhen.json
武汉,http://map.amap.com/service/subway?_1678441605470&srhdata=4201_drw_wuhan.json
天津,http://map.amap.com/service/subway?_1678441632942&srhdata=1200_drw_tianjin.json
南京,http://map.amap.com/service/subway?_1678441642966&srhdata=3201_drw_nanjing.json
香港,http://map.amap.com/service/subway?_1678456913516&srhdata=8100_drw_xianggang.json
重庆,http://map.amap.com/service/subway?_1678459355168&srhdata=5000_drw_chongqing.json
大连,http://map.amap.com/service/subway?_1678459383232&srhdata=2102_drw_dalian.json
苏州,http://map.amap.com/service/subway?_1678459409052&srhdata=3205_drw_suzhou.json
西安,http://map.amap.com/service/subway?_1678459428438&srhdata=6101_drw_xian.json
宁波,http://map.amap.com/service/subway?_1678459444756&srhdata=3302_drw_ningbo.json
南昌,http://map.amap.com/service/subway?_1678459465310&srhdata=3601_drw_nanchang.json
南宁,http://map.amap.com/service/subway?_1678459477832&srhdata=4501_drw_nanning.json
厦门,http://map.amap.com/service/subway?_1678459492138&srhdata=3502_drw_xiamen.json
乌鲁木齐,http://map.amap.com/service/subway?_1678459506272&srhdata=6501_drw_wulumuqi.json
兰州,http://map.amap.com/service/subway?_1678459526156&srhdata=6201_drw_lanzhou.json
太原,http://map.amap.com/service/subway?_1678459539406&srhdata=1401_drw_taiyuan.json
杭州,http://map.amap.com/service/subway?_1678459552624&srhdata=3301_drw_hangzhou.json
成都,http://map.amap.com/service/subway?_1678459564990&srhdata=5101_drw_chengdu.json
佛山,http://map.amap.com/service/subway?_1678459578858&srhdata=4406_drw_foshan.json
郑州,http://map.amap.com/service/subway?_1678496539186&srhdata=4101_drw_zhengzhou.json
无锡,http://map.amap.com/service/subway?_1678496554001&srhdata=3202_drw_wuxi.json
福州,http://map.amap.com/service/subway?_1678496564359&srhdata=3501_drw_fuzhou.json
合肥,http://map.amap.com/service/subway?_1678496574317&srhdata=3401_drw_hefei.json
哈尔滨,http://map.amap.com/service/subway?_1678496584503&srhdata=2301_drw_haerbin.json
温州,http://map.amap.com/service/subway?_1678496599137&srhdata=3303_drw_wenzhou.json
常州,http://map.amap.com/service/subway?_1678496612665&srhdata=3204_drw_changzhou.json
呼和浩特,http://map.amap.com/subway/index.html?&1100
沈阳,http://map.amap.com/service/subway?_1678496640405&srhdata=2101_drw_shenyang.json
长春,http://map.amap.com/service/subway?_1678496651115&srhdata=2201_drw_changchun.json
昆明,http://map.amap.com/service/subway?_1678496662195&srhdata=5301_drw_kunming.json
长沙,http://map.amap.com/service/subway?_1678496671565&srhdata=4301_drw_changsha.json
青岛,http://map.amap.com/service/subway?_1678496682385&srhdata=3702_drw_qingdao.json
东莞,http://map.amap.com/service/subway?_1678496691021&srhdata=4419_drw_dongguan.json
贵阳,http://map.amap.com/service/subway?_1678496700127&srhdata=5201_drw_guiyang.json
石家庄,http://map.amap.com/service/subway?_1678496710188&srhdata=1301_drw_shijiazhuang.json
济南,http://map.amap.com/service/subway?_1678496717844&srhdata=3701_drw_jinan.json
徐州,http://map.amap.com/service/subway?_1678496726494&srhdata=3203_drw_xuzhou.json
import requests as r
import re
import json
def pegkin(city,url):
with open('cheng.txt','r',encoding='utf-8') as a:
tex=a.read()
tex=tex.replace('\n','')
txt=tex.split(' ')
if not url or url=='' or url==None:
for s in txt:
tst=s.split(',')
if city==tst[0]:
url=tst[1]
print(url)
rf=r.get(url)
#获得每个地点和他的位置:
#未找到素材:站点名称
rr=rf.text
js=(json.loads(rr))['l']
jg=[]
for i in js:
xl=[]
name=i['kn']
color=i['cl']
st=i['st']
xl.append(name)
xl.append(color)
for j in st:
stname=j['n']
xl.append(stname)
if city=='北京' and ('地铁2号线'== name or name=='地铁10号线'):
xl.append((st[0])['n'])
if city=='上海' and ('地铁4号线'== name):
xl.append((st[0])['n'])
jg.append(xl)
return jg
技术 |
文件夹字数统计的大概原理 | 词条盖子 |