Created
February 17, 2015 23:10
-
-
Save SteveMcGrath/1065c97beac31a1fd213 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
from BeautifulSoup import BeautifulSoup as soup | |
import re | |
def getdata(filename): | |
rcve = re.compile(r'CVE') | |
with open(filename) as xmlfile: | |
rawdata = soup(xmlfile.read()) | |
for section in rawdata.findAll('section', attrs={'title': rcve}): | |
print section.get('title') | |
for item in section.findAll('infodata'): | |
print '\t',item.get('label'),item.text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment