minimaxir / facebook-page-post-scraper

Data scraper for Facebook Pages, and also code accompanying the blog post How to Scrape Data From Facebook Page Posts for Statistical Analysis
2.12k stars 662 forks source link

IndexError: tuple index out of range #49

Closed cdhit closed 7 years ago

cdhit commented 7 years ago

17200 Statuses Processed: 2017-05-19 21:59:50.230000

Traceback (most recent call last):
  File "C:/xxxxx/facebook-page-post-scraper/get_fb_posts_fb_group.py", line 187, in <module>
    scrapeFacebookPageFeedStatus(group_id, access_token)
  File "C:/xxxxx/facebook-page-post-scraper/get_fb_posts_fb_group.py", line 183, in scrapeFacebookPageFeedStatus
    (num_processed, datetime.datetime.now() - scrape_starttime)))
IndexError: tuple index out of range
paladini commented 7 years ago

Same here :/

minimaxir commented 7 years ago

That line only triggers when the script is done, so you have not lost any data.

Looking at a fix.

paladini commented 7 years ago

Hey @minimaxir , I've fix it by myself too. Just go to line 167 of get_fb_posts_fb_page.py and change this code:

print("\nDone!\n{} Statuses Processed in {}".format(
              (num_processed, datetime.datetime.now() - scrape_starttime)))

For this one:

        print("\nDone!\n{} Statuses Processed in {}".format(
              num_processed, (datetime.datetime.now() - scrape_starttime)))

Hope this helps you :)

minimaxir commented 7 years ago

...well I feel silly. Should have caught that during testing.

paladini commented 7 years ago

Thanks for the fix! I think you can close this issue now.