Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to capture each occurrence of a violation? #181

@wendlingd

Description

@wendlingd

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]))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions