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

New issue about KeyError:'response' #2

Open
2023-FL opened this issue Apr 25, 2022 · 0 comments
Open

New issue about KeyError:'response' #2

2023-FL opened this issue Apr 25, 2022 · 0 comments

Comments

@2023-FL
Copy link

2023-FL commented Apr 25, 2022

Hi,
could any one know how to resolve the issue of KyError about the parameter of 'response' in the command of "count_total_articles = count_total_articles +len(NYTimes_data["response"]["docs"][:])" please?

The follow is a full description of the error:
KeyError Traceback (most recent call last)
in ()
4 with open(file_str) as data_file:
5 NYTimes_data = json.load(data_file)
----> 6 count_total_articles = count_total_articles + len(NYTimes_data["response"]["docs"][:]) #add article number
7 for i in range(len(NYTimes_data["response"]["docs"][:])): # search in every docs for type of material or section = in the list
8 try:

KeyError: 'response'

Best regards,
Francis

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