Open ghost opened 3 years ago
Hi, 5000 is an upper limit. If the post only has 159 comments, only 159 comments will be extracted. Also, you might want to pass cookies, as some comment extraction related functions (like extracting replies) require cookies or credentials
posts = list(get_posts('nintendo', pages=2, options={'comments':True, 'progress': True}, cookies="cookies.txt"))
for post in posts:
print(post.get("post_id"), post.get("comments"), len(post.get("comments_full") or []))
outputs
4168993589851729 438 194
4151037621647326 98 43
4148574141893674 101 70
4144965658921189 533 248
4141878672563221 12 10
4128969113854177 47 0
Also when I add the cookeis file and run your own code:
posts = list(get_posts('nintendo', pages=2, options={'comments':True, 'progress': True}, cookies="cookies.txt"))
for post in posts:
print(post.get("post_id"), post.get("comments"), len(post.get("comments_full") or []))
it gives me this result:
4168993589851729 0 30
4151037621647326 0 30
4148574141893674 0 30
4144965658921189 0 30
4141878672563221 0 10
4128969113854177 0 0
What language do you have set on your account?
What language do you have set on your account?
it
Try switch to English. You'll need to re-export cookies after switching language
Okay, thank you! Now the result is:
4168993589851729 0 229
4151037621647326 0 44
4148574141893674 0 70
4144965658921189 0 251
4141878672563221 0 10
4128969113854177 0 0
What version are you using?
where can i find the version?
pip freeze | grep facebook
Hello! I wanted to ask everyone why with this simple code:
does not return the entire set of comments but only a small part? the number is significantly less than 5000 as explained in the documentation (the number returned is 159) ...What am I doing wrong?