import requests
def platformcode():
headers={
'User - Agent':'',
'Cookie':''
}
params={'station_version': '1.9240'}
session = requests.Session()
session.headers.update(headers)
res=session.get('https://kyfw.12306.cn/otn/resources/js/framework/station_name.js',params=params)
station=res.text.split('|')
i = 0
n = 0
station_name = {}
while True:
name = station[1 + i]
num = station[2 + n]
station_name[name] = num
i = i + 5
n = n + 5
if 2 + n > len(station):
break
return station_name
##user-agent,cookie填自己的