#!/usr/bin/python # -*- coding: utf-8 -*- import json with open('nvdcve.json', 'r') as f: cve_dict = json.loads(f.read()) i = 0 with open('analyse.json', 'w') as outfile: for i in range(0, 5949): try: nvd_impact = cve_dict['CVE_Items'][i]['impact' ]['baseMetricV2']['impactScore'] nvd_id = cve_dict['CVE_Items'][i]['cve']['CVE_data_meta']['ID'] json.dump(nvd_impact, outfile) json.dump(nvd_id, outfile) print (nvd_id) except KeyError: continue
print
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)