Created
April 20, 2018 07:20
-
-
Save lbp0200/51d64224e6550b5c5082ce771f3fc6de to your computer and use it in GitHub Desktop.
鸭题库主管护师复习包
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path, requests, json | |
catalogList = [ | |
{ | |
"Name": "高频考点", | |
"items": [ | |
{ | |
"Icon": "1", | |
"CatalogId": "25", | |
"Taxis": "1", | |
"Name": "主管考点汇总一", | |
"Id": "82" | |
}, | |
{ | |
"Name": "主管考点汇总二", | |
"Id": "83", | |
"CatalogId": "25", | |
"Icon": "1", | |
"Taxis": "2" | |
}, | |
{ | |
"CatalogId": "25", | |
"Id": "84", | |
"Name": "主管考点汇总三", | |
"Icon": "1", | |
"Taxis": "3" | |
}, | |
{ | |
"CatalogId": "25", | |
"Taxis": "4", | |
"Icon": "1", | |
"Name": "主管考点汇总四", | |
"Id": "87" | |
}, | |
{ | |
"Id": "96", | |
"Taxis": "5", | |
"CatalogId": "25", | |
"Icon": "1", | |
"Name": "主管考点汇总五" | |
}, | |
{ | |
"CatalogId": "25", | |
"Icon": "1", | |
"Taxis": "6", | |
"Id": "99", | |
"Name": "主管考点汇总六" | |
}, | |
{ | |
"Icon": "1", | |
"Id": "101", | |
"Taxis": "7", | |
"Name": "主管考点汇总七", | |
"CatalogId": "25" | |
}, | |
{ | |
"Id": "102", | |
"Name": "主管考点汇总八", | |
"Taxis": "8", | |
"Icon": "1", | |
"CatalogId": "25" | |
} | |
], | |
"Taxis": "1", | |
"ShortName": "主管护师考点", | |
"CatalogType": "10", | |
"DataNum": "22", | |
"Id": "25" | |
}, | |
{ | |
"items": [ | |
{ | |
"Icon": "1", | |
"Id": "796", | |
"Taxis": "1", | |
"Name": "15基础知识", | |
"CatalogId": "28" | |
}, | |
{ | |
"CatalogId": "28", | |
"Id": "787", | |
"Name": "15相关专业", | |
"Icon": "1", | |
"Taxis": "2" | |
}, | |
{ | |
"Name": "15内科专业知识", | |
"Id": "797", | |
"Icon": "1", | |
"CatalogId": "28", | |
"Taxis": "3" | |
}, | |
{ | |
"Id": "798", | |
"Taxis": "4", | |
"Name": "15内科实践能力", | |
"Icon": "1", | |
"CatalogId": "28" | |
}, | |
{ | |
"Icon": "1", | |
"CatalogId": "28", | |
"Name": "15外科专业知识", | |
"Id": "786", | |
"Taxis": "5" | |
}, | |
{ | |
"Taxis": "6", | |
"Icon": "1", | |
"Id": "785", | |
"Name": "15外科实践能力", | |
"CatalogId": "28" | |
}, | |
{ | |
"Taxis": "7", | |
"Name": "15妇科专业知识", | |
"Icon": "1", | |
"CatalogId": "28", | |
"Id": "784" | |
}, | |
{ | |
"CatalogId": "28", | |
"Icon": "1", | |
"Name": "15妇科实践能力", | |
"Id": "783", | |
"Taxis": "8" | |
}, | |
{ | |
"Id": "782", | |
"CatalogId": "28", | |
"Taxis": "9", | |
"Icon": "1", | |
"Name": "15儿科实践能力" | |
}, | |
{ | |
"Icon": "1", | |
"CatalogId": "28", | |
"Taxis": "10", | |
"Name": "15护理学专业知识", | |
"Id": "781" | |
}, | |
{ | |
"Taxis": "11", | |
"Id": "780", | |
"Icon": "1", | |
"CatalogId": "28", | |
"Name": "15护理学实践能力" | |
}, | |
{ | |
"Id": "779", | |
"Taxis": "12", | |
"Name": "15社区专业知识", | |
"Icon": "1", | |
"CatalogId": "28" | |
}, | |
{ | |
"Taxis": "13", | |
"CatalogId": "28", | |
"Icon": "1", | |
"Id": "778", | |
"Name": "15社区实践能力" | |
} | |
], | |
"Taxis": "2", | |
"CatalogType": "10", | |
"ShortName": "真题试卷", | |
"DataNum": "14", | |
"Name": "真题试卷", | |
"Id": "28" | |
}, | |
{ | |
"Id": "29", | |
"items": [ | |
{ | |
"CatalogId": "29", | |
"Icon": "1", | |
"Name": "考试大纲", | |
"Id": "788", | |
"Taxis": "100" | |
}, | |
{ | |
"CatalogId": "29", | |
"Name": "备考指南", | |
"Id": "789", | |
"Icon": "1", | |
"Taxis": "78900" | |
}, | |
{ | |
"CatalogId": "29", | |
"Name": "内科记忆口诀", | |
"Icon": "1", | |
"Id": "790", | |
"Taxis": "79000" | |
}, | |
{ | |
"Taxis": "79100", | |
"Id": "791", | |
"Name": "外科记忆口诀", | |
"CatalogId": "29", | |
"Icon": "1" | |
}, | |
{ | |
"CatalogId": "29", | |
"Icon": "1", | |
"Id": "792", | |
"Name": "妇科记忆口诀", | |
"Taxis": "79200" | |
}, | |
{ | |
"CatalogId": "29", | |
"Icon": "1", | |
"Id": "793", | |
"Taxis": "79300", | |
"Name": "儿科记忆口诀" | |
}, | |
{ | |
"Id": "794", | |
"Name": "数值类记忆", | |
"CatalogId": "29", | |
"Taxis": "79400", | |
"Icon": "1" | |
}, | |
{ | |
"Name": "公式记忆", | |
"Icon": "1", | |
"Id": "795", | |
"Taxis": "79500", | |
"CatalogId": "29" | |
} | |
], | |
"CatalogType": "10", | |
"Name": "备考资料", | |
"DataNum": "8", | |
"Taxis": "3", | |
"ShortName": "备考资料" | |
}, | |
{ | |
"Name": "模拟试卷", | |
"ShortName": "模拟试卷", | |
"items": [ | |
{ | |
"Id": "799", | |
"CatalogId": "79", | |
"Taxis": "100", | |
"Name": "妇科实践能力1", | |
"Icon": "1" | |
}, | |
{ | |
"Taxis": "80000", | |
"Id": "800", | |
"Icon": "1", | |
"Name": "妇科专业知识1", | |
"CatalogId": "79" | |
}, | |
{ | |
"Id": "801", | |
"Icon": "1", | |
"Name": "外科实践能力1", | |
"CatalogId": "79", | |
"Taxis": "80100" | |
}, | |
{ | |
"Icon": "1", | |
"CatalogId": "79", | |
"Id": "802", | |
"Taxis": "80200", | |
"Name": "外科专业知识1" | |
}, | |
{ | |
"Icon": "1", | |
"Id": "803", | |
"Name": "内科实践能力1", | |
"CatalogId": "79", | |
"Taxis": "80300" | |
}, | |
{ | |
"Taxis": "80400", | |
"Id": "804", | |
"CatalogId": "79", | |
"Icon": "1", | |
"Name": "内科专业知识1" | |
}, | |
{ | |
"Id": "805", | |
"CatalogId": "79", | |
"Name": "相关专业1", | |
"Icon": "1", | |
"Taxis": "80500" | |
}, | |
{ | |
"Name": "基础知识1", | |
"CatalogId": "79", | |
"Taxis": "80600", | |
"Id": "806", | |
"Icon": "1" | |
}, | |
{ | |
"Name": "儿科专业知识1", | |
"Id": "807", | |
"Taxis": "80700", | |
"Icon": "1", | |
"CatalogId": "79" | |
}, | |
{ | |
"CatalogId": "79", | |
"Name": "儿科实践能力1", | |
"Taxis": "80800", | |
"Id": "808", | |
"Icon": "1" | |
}, | |
{ | |
"Icon": "1", | |
"Taxis": "80900", | |
"CatalogId": "79", | |
"Id": "809", | |
"Name": "护理学专业知识1" | |
}, | |
{ | |
"Id": "810", | |
"Icon": "1", | |
"CatalogId": "79", | |
"Name": "护理学实践能力1", | |
"Taxis": "81000" | |
}, | |
{ | |
"CatalogId": "79", | |
"Taxis": "81100", | |
"Id": "811", | |
"Name": "社区专业知识1", | |
"Icon": "1" | |
}, | |
{ | |
"Name": "社区实践能力1", | |
"Id": "812", | |
"Taxis": "81200", | |
"Icon": "1", | |
"CatalogId": "79" | |
} | |
], | |
"Taxis": "4", | |
"DataNum": "14", | |
"Id": "79", | |
"CatalogType": "10" | |
} | |
] | |
rootPath = '/tmp/主管护师复习包/' | |
for catalog in catalogList: | |
cataName = catalog['Name'] | |
cataPath = os.path.join(rootPath, cataName) | |
if not os.path.exists(cataPath): | |
os.mkdir(cataPath) | |
items = catalog['items'] | |
for item in items: | |
url = 'http://app.yatiku.com/app/getInformationById?Id={0}&catalogId={1}'.format(item['Id'], | |
item['CatalogId']) | |
print(url) | |
r = requests.get(url) | |
resq = r.json() | |
html = resq['item']['Describe'] | |
with open(os.path.join(rootPath, item['Name'] + '.html'), 'w', encoding='gb18030') as f: | |
f.write(html) | |
# exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
根据下载的题库制作的精美电子书
https://pan.baidu.com/s/1QO9HdBVnq5moWCqll1xncw