facebook-scraper icon indicating copy to clipboard operation
facebook-scraper copied to clipboard

get_posts() returns nothing...

Open dingodoppelt opened this issue 1 year ago • 5 comments

...neither using credentials, cookies, setting the language to english, trying the commandline syntax, trying a python script. I think I tried everything mentioned in the issues so far but this leads me to confirm, that this scraper stopped working. I'm on linux (same issue with Manjaro and Ubuntu 22.04) running the latest git master branch

dingodoppelt avatar Mar 14 '23 14:03 dingodoppelt

Same problem here. Always works perfectly until now. Return no post.

Return debug like that : (correct address is hidden)

Starting to iterate pages Requesting page from: https://m.facebook.com/HIDDEN-HIDDEN/ Parsing page response No raw posts (

elements) were found in this page. The page url is: https://www.facebook.com/hidden-hidden/?paipv=0&eav=AfaGCGDQz3iUU_NTm9evhHGV1JisFP-x4s4hYBc_Q3ABdWzM9MXCn6Pp1uw8&_rdr The page content is: +------------------------------------------------------------ | :root{--fds-black:#000000;--fds-black-alpha-05:rgba(0, 0, 0, 0.05);--fds-black-alpha-10:rgba(0, 0, 0, 0.1);--fds-black-alpha-15:rgba(0, 0, 0, 0.15);--fds-black-alpha-20:rgba(0, 0, 0, 0.2);--fds-black-alpha-30:rgba(0, 0, 0, 0.3);--fds-black-alpha-40:rgba(0, 0, 0, 0.4);--fds-black-alpha-50:rgba(0, 0, 0, 0.5);--fds-black-alpha-60:rgba(0, 0, 0, 0.6);--fds-black-alpha-80:rgba(0, 0, 0, 0.8);--fds-blue-05:#ECF3FF;--fds-blue-30:#AAC9FF;--fds-blue-40:#77A7FF;--fds-blue-60.............................

jpkrop avatar Mar 14 '23 14:03 jpkrop

For me scraping posts works as long as I don't use cookies at all, but the number of requests is pretty limited before the IP gets blocked. My findings so far are:

  • facebook-scraper uses the mobile version of facebook to retrieve posts
  • without login, the mobile version can be retrieved
  • with login, I get immediately redirected to the normal facebook page when trying to request the mobile version. Thus no article elements are found.

Any idea on how to fix this?

twitter-79 avatar Mar 20 '23 09:03 twitter-79

I have the same issue and realized that when using account name, the request FB_MOBILE_BASE_URL will redirect to normal facebook page and scraper can't find anything.

But everything work when i add start_url param with url using profile id: "https://m.facebook.com//profile.php?id=...".

Still need to put account name in get_posts func cause i don't want to change the core.

tuanpt avatar Mar 30 '23 03:03 tuanpt

I dont get any results either... Hope that I understood you correctly @tuanpt

>>> for post in get_posts("nintendo", start_url="https://m.facebook.com/profile.php?id=nintendo"):
...   print (post)
... 
>>>

SchmueI avatar May 17 '23 05:05 SchmueI

@SchmueI Did you find any workaround? I am facing the same issue.

Bitsy-Chuck avatar Jul 19 '23 18:07 Bitsy-Chuck