Skip to main content

Comment

A Facebook comment.

Properties​

id : str
Comment ID.
text : str | None
Body text of the comment.
created_time : int | None
Unix timestamp of when the comment was created.
reaction_count : str | None
Number of reactions on the comment.
reply_count : int | None
Number of direct replies.
attachments : list[Photo | Video | GenericMedia | Sticker] | None

Attached media.

owner : Profile | None
The comment's author.
post : Post | None
The parent post.

Methods​

All methods return a PaginatedIterator of model objects.

get_replies() -> PaginatedIterator[Comment]
Direct replies to the comment.
get_reactors() -> PaginatedIterator[Reactor]
Users who reacted to the comment.

Example​

import facebook_gql_scraper as fgs

context = fgs.FacebookContext(cookies_file="facebook_cookies.json")

post = fgs.Post.from_post_id(context, post_id="253053527513133")

for comment in post.get_comments():
print(comment.id, comment.text)

for comment_reply in comment.get_replies():
print(comment_reply.id, comment_reply.text)

# (Facebook's max reply depth)
for subreply in comment_reply.get_replies():
print(subreply.id, subreply.text)
note

Facebook replies max depth is 2.