专栏名称: Python学习交流
每天更新,更新python相关的知识。希望诸君有所收获!
目录
相关文章推荐
Python爱好者社区  ·  月薪3万35岁脑干出血程序员:ICU躺了28 ... ·  昨天  
Python爱好者社区  ·  务必立即拿下软考证(政策红利) ·  2 天前  
Python爱好者社区  ·  软考,yyds ·  昨天  
Python爱好者社区  ·  Science披露:近3年,垃圾论文激增,9 ... ·  2 天前  
51好读  ›  专栏  ›  Python学习交流

还在医院苦苦排队挂号?Python定时自动挂号和快捷查询化验报告!

Python学习交流  · 公众号  · Python  · 2019-01-25 13:32

正文

请到「今天看啥」查看全文



'User-Agent': "health",
'Host': "zyyy.zwjk.com",
'Connection': "Keep-Alive",
'Accept': "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
'cache-control': "no-cache",
}
response = requests_session.post(url, data={"requestData":json.dumps(payload)}, headers=headers)
if response.status_code != 200:
return False
resp_json = response.json()
return_params = resp_json['return_params']['list']
for key in return_params:
if int(key['date']) == int(appointment_date):
doctor_info = key['doctor']
for i in doctor_info:
if i['id'] == 1960 and i['schedulList'][0]['am_pm_flag'] == "1":
return True
def get_time(session_id):
pre_date = (time_now + datetime.timedelta(days=7)).strftime("%Y-%m-%d")
url = "https://zyyy.zwjk.com/api/exec.htm"
payload = {
"api_Channel": "1",
"client_version": "3.6.6",
"app_id": "zyyy_android",
"app_key": "xxxx",
"user_type": "0",
"client_mobile": "863008041030718",
"api_name": "api.yygh.remain.num",
"params": {
"sourceId": "12",
"planId": 9759,
"orderDate": str(pre_date),
"ampmFlag": "1"
},
"session_id": session_id
}
headers = {
'Content-Type': "application/x-www-form-urlencoded",
'User-Agent': "health",
'Host': "zyyy.zwjk.com",
'Connection': "Keep-Alive",
'Accept': "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
'cache-control': "no-cache",
}
response = requests_session.post(url, data={"requestData": json.dumps(payload)}, headers=headers)
if response.status_code != 200:
return False
resp_json = response.json()
regno = resp_json['return_params']['list'][0]['regno']
timespan = resp_json['return_params']['list'][0]['timespan']
return [regno,timespan]
# 在指定时间挂号
def set_doctor_number(session_id,pre_date,reg_no,timeregion):
url = "https://zyyy.zwjk.com/api/exec.htm"
payload = {
"api_Channel": "1",
"client_version": "3.6.6",
"app_id": "zyyy_android",
"app_key": "Zxxxx",
"user_type": "0",
"client_mobile": "863008041030718",
"api_name": "api.yygh.expert.reservation",
"params": {
"card_no": "x'x'x'x", # 社保卡号
"doct_name": "华佗", # 专家名称
"user_name": "xxx", # 你的姓名
"id_card": "xxxxx", # 身份证号
"phone": "xxxx", # 电话
"reg_id": "xxxx",
"reg_no": reg_no, # 预约号
"dept_name": "科室",
"yuanqu_type": "1",
"type": "1",
"dept_id": 103060302,
"pre_date": str(pre_date), #预约日期
"week_day": "3", # 预约日期是星期几





请到「今天看啥」查看全文