Code Monkey home page Code Monkey logo

Comments (4)

minimaxir avatar minimaxir commented on July 23, 2024

HTTP error 400 is a Bad Request, which means either your App ID or App Secret are incorrect. Can you double check?

from facebook-page-post-scraper.

iblind avatar iblind commented on July 23, 2024

Hey Max, was there any more on this front? I had something similar happen today:

XXX Comments Processed: 2016-09-07 14:29:15.632319
HTTP Error 400: Bad Request
Error for URL https://graph.facebook.com/v2.6/10153459535612217_10153459625697217/comments?fields=id,message,like_count,created_time,comments,from,attachment&order=chronological&limit=100&access_token=<APP|TOKEN>: 2016-09-07 14:29:26.333514
Retrying.
Traceback (most recent call last):
  File "get_fb_comments.py", line 173, in <module>
    scrapeFacebookPageFeedComments(file_id, access_token)
  File "get_fb_comments.py", line 125, in scrapeFacebookPageFeedComments
    for subcomment in subcomments['data']:
TypeError: 'NoneType' object has no attribute '__getitem__'

from facebook-page-post-scraper.

minimaxir avatar minimaxir commented on July 23, 2024

Thanks for providing the stack trace. I'm not 100% sure what happening, but it may be possible to add safeguards. Looking into it.

from facebook-page-post-scraper.

iblind avatar iblind commented on July 23, 2024

Think I've figured out what's up. FB seems to indicate that there are comments at time when there may not be, so all this would require is an
if 'data' in subcomments:
statement prior to the loop, just like you had set up in the following section.

This is actually something that came up for me in line 66-
comment_author = unicode_normalize(comment['from']['name'])
which has previously led to KeyError: 'name'

This looks like it can be solved by changing that line to

comment_author = '' if 'name' not in comment['from'] else \ unicode_normalize(comment['from']['name'])

Can submit a pull request in a little bit for you to review?

from facebook-page-post-scraper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.