使用响应的json数据判断订单查询是否成功;
#查询中通快递import requestsrr=requests.session()headers={"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"}data={"billCode":"75314795362855"}a=rr.get("https://hdgateway.zto.com/WayBill_GetDetail",params=data,headers=headers,verify=False)if ‘成功‘ in a.json()[‘message‘]: print(‘查询的中通快递编号正确‘)else: print("查询的中通快递编号错误")