import requests
from random import random
import conf
point = {
‘1‘: ‘3267‘
‘2‘: ‘10767‘
‘3‘: ‘18067‘
‘4‘: ‘25067‘
‘5‘: ‘32129‘
‘6‘: ‘107129‘
‘7‘: ‘180129‘
‘8‘: ‘250129‘
}
def get_answer(index):
index = index.split(‘‘)
temp = []
for item in index:
temp.append(point[item])
return ‘‘.join(temp)
session = requests.Session()
headers = {
‘User-Agent‘: ‘Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML like Gecko‘
‘) Chrome/67.0.3396.99 Safari/537.36‘
}
s = random()
captcha_url = ‘https://kyfw.12306.cn/passport/captcha/captcha-image?login_site=E&module=login&rand=sjrand&%s‘ % s
response =
评论
共有 条评论