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

[Breaking Bug] get_post is not returning any posts #1070

Open
moda20 opened this issue Nov 11, 2023 · 14 comments
Open

[Breaking Bug] get_post is not returning any posts #1070

moda20 opened this issue Nov 11, 2023 · 14 comments

Comments

@moda20
Copy link

moda20 commented Nov 11, 2023

Trying this example with cookies, doesn't yield any posts

for post in get_posts('nintendo', pages=1):
    print(post['text'][:50])

it seems to not find posts in pages here :

                for post_element in page:
                    post = extract_post_fn(post_element, options=options, request_fn=self.get)
                    if remove_source:
                        post.pop('source', None)
                    yield post

Is there anything missing ?

@eric09230
Copy link

Maybe you can try issue #1066
It's working for me.

@moda20
Copy link
Author

moda20 commented Nov 12, 2023

@eric09230 I tried that but it's not working for me at all, still getting the same zero posts.

@moda20
Copy link
Author

moda20 commented Nov 13, 2023

@kevinzg @eric09230 It seems the code references the layout used by mbasic facebook, not the m.facebook. but the URL used to start the scrapping is m.facebook which results in completely different UI and no posts returned. Can someone look into this ?

@eric09230
Copy link

Did you login properly?I also can't get any post but after I login by cookie.json I can see the post has been scrapt.

@eric09230
Copy link

But I keep getting banned. So I'm using this https://github.com/shaikhsajid1111/facebook_page_scraper instead.
No more banned message.

@moda20
Copy link
Author

moda20 commented Nov 19, 2023

@eric09230 Yes i did login, i plan on trying with a different account btu i fear facebook will ban me an my actual account. i will try the other repo and see

@moda20
Copy link
Author

moda20 commented Nov 25, 2023

@eric09230 I figured what the issue is. it seems for my case m.facebook layout has completely changed and this repo is not made to scrap that.
the fix was to use startUrl props to specifically use the mbasic.facebook version which still works well with this repo. (start_url="https://mbasic.facebook.com/?v=timeline"). the v=timeline argument is mandatory as the repo doesn't go there on it's own.

the second issue is one with high res images of posts, the image link has changed and the repo needed a small update, i updated it on my fork : https://github.com/moda20/facebook-scraper

@ooker777
Copy link

ooker777 commented Nov 29, 2023

if it doesn't require an API key, then how come you have to login? And where is the login info stored?

Plus that the last commit is Oct-10, how come it can be broken from then?

mohit2jain referenced this issue in moda20/facebook-scraper Dec 3, 2023
@LuciaIllari
Copy link

it seems for my case m.facebook layout has completely changed and this repo is not made to scrap that. the fix was to use startUrl props to specifically use the mbasic.facebook version which still works well with this repo. (start_url="https://mbasic.facebook.com/?v=timeline"). the v=timeline argument is mandatory as the repo doesn't go there on it's own.

Sorry to bug, but when you say adding a starting url works, for example how would you incorporate that in this code:

for post in get_posts('nintendo', pages=1): print(post['text'][:50])

Would you mind explaining how you are incorporating the start_url?

@moda20
Copy link
Author

moda20 commented Dec 3, 2023

@LuciaIllari using the nintendo example, use the start url like this :

for post in get_posts(account="nintendo", start_url="https://mbasic.facebook.com/nintendo?v=timeline",
              cookies='<Path to your cookies file>')) : 
    print(post['text'][:50])

@TBKRK
Copy link

TBKRK commented Dec 4, 2023

I have the same problem since December 2nd. Previously I could receive posts from one account, now I only receive empty []. Configuring start_url does not solve the problem.
I use cookies, but changing to "credentials", even with other user or different IP doesn't help.
Has Facebook made any changes?

@bluusun
Copy link

bluusun commented Dec 14, 2023

Repo stopped working for me getting Facebook Page data about two weeks ago - I get no posts found now.

@Zhigalin
Copy link

same here cant scrape a thing

@moda20
Copy link
Author

moda20 commented Dec 15, 2023

@bluusun @Zhigalin please check this fork that i am working on : https://github.com/moda20/facebook-scraper
it's not a drop in replacement however please check the readme before trying the old examples

UlyssesZh added a commit to UlyssesZh/facebook-discord that referenced this issue Jan 22, 2024
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

7 participants