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

Use facebook_scraper to exact posts, comments based on hashtag on a certain date #1096

Open
ZheyiXu opened this issue Apr 7, 2024 · 0 comments

Comments

@ZheyiXu
Copy link

ZheyiXu commented Apr 7, 2024

I am new to Python and trying to use facebook_scraper to collect data.

import facebook_scraper as fs

HASHTAGID = "theone"

MAX_COMMENTS = 10

MAX_POSTS = 10

gen = fs.get_posts(
    hashtag=HASHTAGID,
    options={"comments": MAX_COMMENTS, "progress": True, "time": datetime.date(2016,8,4)}
)

post = next(gen)
comments = post['comments_full']

But I receive error message below

---------------------------------------------------------------------------
StopIteration                             Traceback (most recent call last)
<ipython-input-35-88c9d27c2318> in <module>
     10 )
     11 
---> 12 post = next(gen)
     13 #comments = post['comments_full']
     14 

StopIteration: 

How should I revise the code?

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