Created
March 13, 2009 01:26
-
-
Save khafatech/78385 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
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