Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

KeyError: 'next' = if there is no next page #97

Open
bhagyashreeborate opened this issue Feb 2, 2018 · 1 comment
Open

KeyError: 'next' = if there is no next page #97

bhagyashreeborate opened this issue Feb 2, 2018 · 1 comment

Comments

@bhagyashreeborate
Copy link

I ran how_to_build_facebook_scrapper to get data from pages. The script is giving me all the results I want in csv file.
But once all the pages are done and there is no next in statuses it gives me an error saying KeyError: 'next'

How can remove this error and get the last result saying %s Statuses Processed in %s.

@wendyhu
Copy link

wendyhu commented May 9, 2018

You can just test if 'next' field exists in statuses dictionary, something like:

if 'paging' in statuses and next in statuses:

It should prevent to throw out error

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants