kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.35k stars 626 forks source link

Null likes and comments #290

Closed lalahas closed 3 years ago

lalahas commented 3 years ago

Hello I would be very grateful for the help

From today, my public pages scraping gives 0 likes and comments. I tried to change the proxy, but it didn't help either.

import datetime
import pandas as pd
from facebook_scraper import get_posts
welt_list =  []
for post in get_posts("welt", pages = 50):
    welt_list.append(post)
    if post.get("time") < datetime.datetime(2021, 5, 17):
        break

df = pd.DataFrame(welt_list)
df.to_csv('weltcw20.csv', index=False)

Could there be a problem with cookies? cookies = "cookies.txt" raises a error

lalahas commented 3 years ago

Solved. The Problem was in proxy

neon-ninja commented 3 years ago

I tested with

for post in get_posts("welt"):
    print(post.get("post_id"), post.get("likes"), post.get("comments"))

and got

10160098320523115 23 17
10160098228118115 15 12
10160098142278115 17 22
10160098034508115 425 80
10160097921213115 18 6
10160097823723115 1373 123
10160097719343115 641 430
10160097624053115 724 284
10160097554583115 57 169
10160097483393115 18 22
10160097414858115 14 6
10160097344728115 37 60
10160097265128115 939 163
10160097194738115 104 54
10160097126813115 436 25
10160097073498115 965 89
10160096996628115 179 92
10160096952953115 24 74
10160096884303115 33 125
10160096847413115 62 28
10160096779288115 40 62
10160095773138115 17 2
10160095664383115 16 5
10160095571858115 59 65
10160095440968115 18 16
10160095288523115 3 1
10160095148843115 10 9
10160095040493115 52 29
10160094952023115 243 609
10160094874713115 441 258
10160094803468115 49 54
10160094724248115 52 96
10160094654388115 21 58
10160094586058115 60 38
10160094521718115 222 33
10160094441043115 118 507
10160094353943115 132 142
10160094248848115 96 102