kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.29k stars 616 forks source link

Comments always show 0 when cookies is set #234

Closed hc2021hc closed 3 years ago

hc2021hc commented 3 years ago

I find that when cookies is set, comments_full can be returned but comments always show 0. Any solution?

fashan7 commented 3 years ago

Yes, I also noted that the comment countis always 0 from today. When I test

neon-ninja commented 3 years ago

This is likely because the HTML differs if you're logged in:

Cookies:

<div class="_1fnt">
  <span class="_1j-c" data-sigil="comments-token">1 comment</span>
  <span class="_1j-c">21 shares</span>
</div>

No cookies:

<span class="_28-d" id="u_4_6_ye">
  <span class="like_def _28wy">23 Likes</span>
  <span class="cmt_def _28wy">1 comment</span>
</span>
neon-ninja commented 3 years ago

https://github.com/kevinzg/facebook-scraper/commit/c2862505b5214235bfb737b982e43c9efb5d4efc this should fix it

fashan7 commented 3 years ago

Thanks

hc2021hc commented 3 years ago

Thanks. It's okay now.