chenze0971 2021-11-23 20:55 采纳率: 85.7%
浏览 48
已结题

用python爬取JSON数据时,结果显示【】,里面没有内容

问题遇到的现象和发生背景

想用python爬取JSON数据,但爬取结果是空白
常规
请求 URL: http://172.21.249.14:16509/Common/GetSqlJson
请求方法: POST
状态代码: 200 OK
远程地址: 172.21.249.14:16509
引用站点策略: strict-origin-when-cross-origin
响应头
Cache-Control: private
Content-Encoding: gzip
Content-Length: 2484
Content-Type: text/json; charset=utf-8
Date: Tue, 23 Nov 2021 10:39:48 GMT
Server: Microsoft-IIS/8.5
Vary: Accept-Encoding
X-AspNet-Version: 4.0.30319
X-AspNetMvc-Version: 5.2
X-Powered-By: ASP.NET
请求biao头
Accept: application/json, text/javascript, /; q=0.01
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6
Connection: keep-alive
Content-Length: 168
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Host: 172.21.249.14:16509
Origin: http://172.21.249.14:16509
Referer: http://172.21.249.14:16509/?calltype=1&his_id=157485482||444
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36 Edg/95.0.1020.53
X-Requested-With: XMLHttpRequest
> 表单数据
XML_NAME: 检验报告
NODE_NAME: 获取全部结果信息
PARAMETERS: 20211120G0065094
DB_TYPE: LIS
响应
[{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"609","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"B10","ITEM_ENAME":"RBC","ITEM_CNAME":"*红细胞计数","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"3.55","QUALITATIVE_RESULT_ORG":"l","QUALITATIVE_RESULT":"↓","ITEM_REFERENCE":"4.3-5.8","ITEM_UNIT":"10^12/L","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"1","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"3.76↓","QUALITATIVE_RESULT_ORG1":"l","QUANTITATIVE_RESULT_SHOW":"3.55↓","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"610","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"B11","ITEM_ENAME":"HGB","ITEM_CNAME":"*血红蛋白","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"117","QUALITATIVE_RESULT_ORG":"l","QUALITATIVE_RESULT":"↓","ITEM_REFERENCE":"130-175","ITEM_UNIT":"g/L","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"2","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"122↓","QUALITATIVE_RESULT_ORG1":"l","QUANTITATIVE_RESULT_SHOW":"117↓","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"611","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"B12","ITEM_ENAME":"HCT","ITEM_CNAME":"红细胞压积","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"0.34","QUALITATIVE_RESULT_ORG":"l","QUALITATIVE_RESULT":"↓","ITEM_REFERENCE":"0.40-0.50","ITEM_UNIT":"L/L","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"3","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"0.36↓","QUALITATIVE_RESULT_ORG1":"l","QUANTITATIVE_RESULT_SHOW":"0.34↓","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"612","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"B13","ITEM_ENAME":"MCV","ITEM_CNAME":" 平均红细胞体积","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"96.6","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"82-100","ITEM_UNIT":"fL","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"4","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"95.7 ","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"96.6 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"613","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"B14","ITEM_ENAME":"MCH","ITEM_CNAME":" 平均红细胞HGB含量","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"33.0","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"27-34","ITEM_UNIT":"pg","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"5","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"32.4 ","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"33.0 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"614","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"B15","ITEM_ENAME":"MCHC","ITEM_CNAME":" 平均红细胞HGB浓度","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"341","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"316-354","ITEM_UNIT":"g/L","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"6","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"339 ","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"341 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"616","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"B16","ITEM_ENAME":"RDW-SD","ITEM_CNAME":" RBC分布宽度SD","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"43.8","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"37.0-54.0","ITEM_UNIT":"fL","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"7","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"41.8 ","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"43.8 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"615","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"B17","ITEM_ENAME":"RDW-CV","ITEM_CNAME":" RBC分布宽度CV","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"12.2","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"11.5-14.5","ITEM_UNIT":"%","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"8","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"12.0 ","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"12.2 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"618","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"B19","ITEM_ENAME":"PLT","ITEM_CNAME":"*血小板计数","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"213","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"100-300","ITEM_UNIT":"10^9/L","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"9","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"246 ","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"213 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"624","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"B25","ITEM_ENAME":"WBC","ITEM_CNAME":"*白细胞计数","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"8.59","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"3.5-9.5","ITEM_UNIT":"10^9/L","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"10","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"14.15↑","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"8.59 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"695","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"C154","ITEM_ENAME":"NEUT%","ITEM_CNAME":" 中性分叶核粒细胞百分率","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"64.6","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"40-75","ITEM_UNIT":"%","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"11","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"64.0 ","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"64.6 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"696","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"C155","ITEM_ENAME":"LYMPH%","ITEM_CNAME":" 淋巴细胞百分率","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"13.9","QUALITATIVE_RESULT_ORG":"l","QUALITATIVE_RESULT":"↓","ITEM_REFERENCE":"20-50","ITEM_UNIT":"%","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"12","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"20.0 ","QUALITATIVE_RESULT_ORG1":"l","QUANTITATIVE_RESULT_SHOW":"13.9↓","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"698","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"C157","ITEM_ENAME":"MONO%","ITEM_CNAME":" 单核细胞百分率","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"10.0","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"3-10","ITEM_UNIT":"%","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"13","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"10.0 ","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"10.0 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"699","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"C158","ITEM_ENAME":"EO%","ITEM_CNAME":" 嗜酸性粒细胞百分率","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"10.8","QUALITATIVE_RESULT_ORG":"h","QUALITATIVE_RESULT":"↑","ITEM_REFERENCE":"0.4-8.0","ITEM_UNIT":"%","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"14","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"1.0 ","QUALITATIVE_RESULT_ORG1":"h","QUANTITATIVE_RESULT_SHOW":"10.8↑","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"700","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"C159","ITEM_ENAME":"BASO%","ITEM_CNAME":" 嗜碱性粒细胞百分率","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"0.7","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"0-1","ITEM_UNIT":"%","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"15","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"1.0 ","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"0.7 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"701","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"C160","ITEM_ENAME":"BLA%","ITEM_CNAME":" 原始细胞百分率","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"/","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"<0","ITEM_UNIT":"%","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"1","SERIAL_NO":"16","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"/ ","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"/ ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"3829","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"C184","ITEM_ENAME":"","ITEM_CNAME":"晚幼红细胞","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"0","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"<1","ITEM_UNIT":"/100个细胞","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"3","SERIAL_NO":"17","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"0 ","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"0 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"735","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"C194","ITEM_ENAME":"NEUT#","ITEM_CNAME":" 中性分叶核粒细胞绝对值","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"5.55","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"1.8-6.3","ITEM_UNIT":"10^9/L","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"3","SERIAL_NO":"18","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"9.06↑","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"5.55 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"736","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"C195","ITEM_ENAME":"LYMPH#","ITEM_CNAME":" 淋巴细胞绝对值","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"1.19","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"1.1-3.2","ITEM_UNIT":"10^9/L","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"3","SERIAL_NO":"19","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"2.83 ","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"1.19 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"738","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"C197","ITEM_ENAME":"MONO#","ITEM_CNAME":" 单核细胞绝对值","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"0.86","QUALITATIVE_RESULT_ORG":"h","QUALITATIVE_RESULT":"↑","ITEM_REFERENCE":"0.1-0.6","ITEM_UNIT":"10^9/L","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"3","SERIAL_NO":"20","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"1.42↑","QUALITATIVE_RESULT_ORG1":"h","QUANTITATIVE_RESULT_SHOW":"0.86↑","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"739","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"C198","ITEM_ENAME":"EO#","ITEM_CNAME":" 嗜酸细胞绝对值","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"0.93","QUALITATIVE_RESULT_ORG":"h","QUALITATIVE_RESULT":"↑","ITEM_REFERENCE":"0.02-0.52","ITEM_UNIT":"10^9/L","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"3","SERIAL_NO":"21","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"0.14 ","QUALITATIVE_RESULT_ORG1":"h","QUANTITATIVE_RESULT_SHOW":"0.93↑","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""},{"INSPECTION_ID":"20211120G0065094","ITEM_ID":"740","INSPECTION_DATE":"20211120","INSPECTION_TIME":"100059","ITEM_SORT":"C199","ITEM_ENAME":"BASO#","ITEM_CNAME":" 嗜碱细胞绝对值","ORIGINAL_RESULT":"","QUANTITATIVE_RESULT":"0.06","QUALITATIVE_RESULT_ORG":"z","QUALITATIVE_RESULT":" ","ITEM_REFERENCE":"0.0-0.06","ITEM_UNIT":"10^9/L","TEST_ORDER":"LIS0365","TEST_METHOD":"","REMARK":"3","SERIAL_NO":"22","IF_OEDIT":"1","ITEM_GUIDELINE":"临床意义","CLINICAL_SIGNIFICANCE":"","HIS_QUANTITATIVE_RESULT":"0.14↑","QUALITATIVE_RESULT_ORG1":"z","QUANTITATIVE_RESULT_SHOW":"0.06 ","GROUP_ID":"G006","DIAGNOSIS_ADVICE":""}]

问题相关代码,请勿粘贴截图

import requests
import json
post_url = 'http://172.21.249.14:16509/Common/GetSqlJson'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36 Edg/95.0.1020.53'
}
word = input('enter a word')
data = {
'PARAMETERS': word
}
response = requests.post(url=post_url, data=data, headers=headers)
dic_obj = response.json()
fileName = word+',json'
fp = open(fileName, 'w', encoding='utf-8')
json.dump(dic_obj, fp=fp, ensure_ascii=False)
print('over')

运行结果及报错内容

[ ](里面没有内容)

我的解答思路和尝试过的方法
我想要达到的结果

想要爬取响应里面的内容

  • 写回答

1条回答 默认 最新

  • 关注

    输出下print(response.text)看看返回的数据是不是json数据
    你把请求头和表单数据都加上试

    import requests
    import json
    post_url = 'http://172.21.249.14:16509/Common/GetSqlJson'
    headers = {
    'Host': '172.21.249.14:16509',
    'Origin': 'http://172.21.249.14:16509',
    'Referer': 'http://172.21.249.14:16509/?calltype=1&his_id=157485482||444',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36 Edg/95.0.1020.53'
    }
    word = input('enter a word')
    data = {
    'XML_NAME': '检验报告',
    'NODE_NAME': '获取全部结果信息',
    'DB_TYPE': 'LIS',
    'PARAMETERS': word
    }
    response = requests.post(url=post_url, data=data, headers=headers)
    print(response.text)
    dic_obj = response.json()
    fileName = word+',json'
    fp = open(fileName, 'w', encoding='utf-8')
    json.dump(dic_obj, fp=fp, ensure_ascii=False)
    print('over')
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录

报告相同问题?

问题事件

  • 系统已结题 12月2日
  • 已采纳回答 11月24日
  • 创建了问题 11月23日

悬赏问题

  • ¥15 C++扑克牌游戏的编程
  • ¥15 有人能看一下我宿舍管理系统的报修功能该怎么改啊?链表那里总是越界
  • ¥15 cs loadimage运行不了,easyx也下了,没有用
  • ¥15 r包runway详细安装教程
  • ¥15 Html中读取Json文件中数据并制作表格
  • ¥15 谁有RH342练习环境
  • ¥15 STM32F407 DMA中断问题
  • ¥15 uniapp连接阿里云无法发布消息和订阅
  • ¥25 麦当劳点餐系统代码纠错
  • ¥15 轮班监督委员会问题。