Skip to content

Instantly share code, notes, and snippets.

@khafatech
Created Mar 13, 2009
Embed
What would you like to do?
elements = ['FINDING_ID', 'FINDING_STATUS', 'FINDING_DETAILS', 'SCRIPT_RESULTS', 'TOOL', 'TOOL_VERSION', 'AUTHENTICATED_FINDING', 'GD_VUL_NAME', 'GD_SEVERITY']
def process_finding(finding):
global elements
d = {}
for element in elements:
result = finding.getElementsByTagName(element)
# Element dne
if len(result) == 0:
d[element] = ""
# get first matching
else:
d[element] = result[0].firstChild.data
return d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment