Closed Saul-Github closed 11 months ago
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?
@TBKRK they did some changes, they always do in fact, regularly. be sure you are using the right credentials,
Does anyone here has any solution, maybe an alternative. I'm desperate
@moda20 credentials are fine... It just stopped working...
The same problem. First in FB's responses disappeared "top_level_post_id". Then disappeared something else, I don't understand yet.
@volodkindv Yes mbasic stopped returning "top_level_post_id", i updated my repo (https://github.com/moda20/facebook-scraper) to get the id form other places
@moda20 So hey I'm quite new how can I install and use your repo instead of the master one
@HienNguyenPhan remove the existent facebook-scrapper entry in you requirements.txt and replace it with this :
facebook-scraper @ git+https://github.com/moda20/facebook-scraper.git@master
and run the install command
or use pip to force update the repo like this :
pip install --force-reinstall --no-deps git+https://github.com/moda20/facebook-scraper.git@master
@moda20 Hello, maybe it solves "top_level_post_id" problem but my script still doesn't work: from facebook_scraper import get_posts
x = get_posts(account='mpkkrakow', cookies='cookies.json', pages=5)
print(x)
for post in x: print(post)
@TBKRK please do the research, you need to use teh start_url attribute to get the posts, the default url uses m.facebook which is not supported anymore for most regions and cookies , check here : https://github.com/kevinzg/facebook-scraper/issues/1070#issuecomment-1837606566
@moda20 still the same :(
from facebook_scraper import get_posts
x = get_posts(account = "mpkkrakow", start_url="https://mbasic.facebook.com/mpkkrakow?v=timeline", cookies='cookies.json', pages=5)
print(x)
for post in x: print(post)
@moda20 wait... I changet to "credentials" and different user/password - it works! Maybe my account is banned?
try to extract new cookies from the main website, visit all the 3 different websites (fb.com, m.fb.com, mbasic.fb.com) and then extract your new cookies in TXT format, old ones will not work. also be sure that you can access your cookies from where your script it being ran
@moda20 ok... It works with my old credentials. I extracted new cookies - it also works!
Thank you!
@moda20 one more... please take a look at attached screen. Some posts have bigger font size. They are not get properly from the page (only part of the text is loaded) :(
@moda20 when I use your solution I cannot have more than 5 posts even when I indicate the number of pages at 20
@aymen-ch Please open a new issue on my repo with a bit more details
When I was trying to get posts by the following codes, I did not got error, or results. I only got WARNING: facebook_scraper.page_iterators:No raw posts (article elements) were found in this page