import json
import requests
header = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Edg/102.0.1245.33'
}
url = 'http://scxk.nmpa.gov.cn:81/xk/itownet/portalAction.do?hKHnQfLv=5'
data = {
'on': 'true',
'page': '1',
'pageSize': '15',
'productName':'',
'conditionType': '1',
'applyname':'',
'applysn':''
}
response = requests.post(url=url,headers=header,data=data).json()
D:\anaconda\anconda\python.exe D:/pythonProject1/藥監總局.py
Traceback (most recent call last):
File "D:\anaconda\anconda\lib\site-packages\requests\models.py", line 910, in json
return complexjson.loads(self.text, **kwargs)
File "D:\anaconda\anconda\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "D:\anaconda\anconda\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "D:\anaconda\anconda\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 4 column 1 (char 6)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\pythonProject1\藥監總局.py", line 17, in
response = requests.post(url=url,headers=header,data=data).json()
File "D:\anaconda\anconda\lib\site-packages\requests\models.py", line 917, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: [Errno Expecting value]
: 6
進程已結束,退出代碼1