Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to capture each occurrence of a violation? #181

Open
wendlingd opened this issue Sep 1, 2020 · 0 comments
Open

How to capture each occurrence of a violation? #181

wendlingd opened this issue Sep 1, 2020 · 0 comments

Comments

@wendlingd
Copy link

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]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant