axe-selenium-python
axe-selenium-python copied to clipboard
How to capture each occurrence of a violation?
Would be much appreciated if this package were to be updated. In the mean time, would there be a way to capture more than one occurrence of each violation? I try to put them into a data frame; something not working.
problemsInJson = response["violations"] # Grab the JSON of _violations_.
errorCount = len(problemsInJson)
if errorCount >= 1:
for errorRow in problemsInJson:
currIssue = errorRow['help']
currHelpUrl = errorRow['helpUrl']
TagList = errorRow['tags']
currTags = ', '.join(TagList)
for node in errorRow['nodes']:
currHtmlCode = node['html']
TargetList = node['target']
currTarget = ', '.join(TargetList)
resultTable = resultTable.append(pd.DataFrame({'Page': currPage,
'Issue': currIssue,
'helpUrl': currHelpUrl,
'tags': currTags,
'html': currHtmlCode,
'target': currTarget}, index=[index + 1]))