import json
import requests
url = 'http://scxk.nmpa.gov.cn:81/xk/itownet/portalAction.do'
page = input('请输入查看药监局第几页的企业:')
data = {
'method': 'getXkzsList',
'on': 'true',
'page': page,
'pageSize': '15',
'productName': '',
'conditionType': '1',
'applyname': '',
'applysn': ''
}
header={
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36'
}
respone = requests.post(url=url, data=data, headers=header)
dic = respone.json()
fp = open('./yaojianju.json', 'w', encoding='utf-8')
json.dump(dic, fp=fp, ensure_ascii=False)
number = int(input('请输入查看药监局第几家的企业:'))-1
id = dic['list'][number]['ID']
print(dic['list'][number]['ID'])
url = 'http://scxk.nmpa.gov.cn:81/xk/itownet/portalAction.do'
data = {
'method': 'getXkzsById',
'id': id
}
header={
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36'
}
respone = requests.post(url=url, data=data, headers=header)
dic = respone.json()
businessPerson = dic['businessPerson']
print(businessPerson)
filename = businessPerson + '.json'
fp = open(filename, 'w', encoding='utf-8')
json.dump(dic, fp=fp, ensure_ascii=False)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)