Skip to content

Instantly share code, notes, and snippets.

@SteveMcGrath
Created February 17, 2015 23:10
Show Gist options
  • Save SteveMcGrath/1065c97beac31a1fd213 to your computer and use it in GitHub Desktop.
Save SteveMcGrath/1065c97beac31a1fd213 to your computer and use it in GitHub Desktop.
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