Closed
Description
遇到一个BUG,挂号时的 response 不是 json 而是一个 html
bjguahao.py > get_it() > response = self.browser.post(self.confirm_url , data=preload)
尝试测试了一下,结果弄得我自己一头雾水。
在 Chrome 上手动挂号,挂号时同样是
- 向 http://www.bjguahao.gov.cn/order/confirm.htm 发 post
- post 数据是这样的
dutySourceId:45004502
hospitalId:122
departmentId:200001019
doctorId:200287869
patientId:**********
hospitalCardId:
medicareCardId:
reimbursementType:-1
smsVerifyCode:763466
childrenBirthday:
isAjax:true
- 返回值如下:
code:200
data:******
hasError:false
msg:"OK"
用脚本挂同一个号,post 的数据基本一致,除了SMS码和reimbursementType,但返回值的response.text
却是个HTML,且挂号不成功。
将response.text
写入文件后发现是选择时间的那个挂号页。