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

Profile information only sometime s working?

Open Rapid1898-code opened this issue 1 year ago • 4 comments

Hello - i try to get some informations from facebook-profiles with the following code: (the cookies i generated using the chrome Get cookies.txt extension)

from facebook_scraper import get_profile
erg = get_profile("zuck", cookies="cookie.txt")
for k,v in erg.items():
  print(f"\n{k}: {v}")  

This generally works fine for some facebook-sites like (besides some warnings that Facebook says "Unsupported Browser" whatever that means...) erg = get_profile("zuck", cookies="cookie.txt") or erg = get_profile("HotelDiplomatic", cookies="cookie.txt")

But with other facebook-sites like erg = get_profile("ParkHyattMendoza", cookies="cookie.txt") this is not working and i get the following error

$ python exmplFBScraper.py
G:\DEV\.venv\fb\lib\site-packages\facebook_scraper\facebook_scraper.py:912: UserWarning: Facebook says 'Unsupported Browser'
  warnings.warn(f"Facebook says 'Unsupported Browser'")
Traceback (most recent call last):
  File "G:\DEV\Python-Diverses\Facebookscraper\exmplFBScraper.py", line 38, in <module>
    erg = get_profile("ParkHyattMendoza", cookies="cookie.txt")
  File "G:\DEV\.venv\fb\lib\site-packages\facebook_scraper\__init__.py", line 85, in get_profile
    return _scraper.get_profile(account, **kwargs)
  File "G:\DEV\.venv\fb\lib\site-packages\facebook_scraper\facebook_scraper.py", line 403, in get_profile
    response = self.get(about_url)
  File "G:\DEV\.venv\fb\lib\site-packages\facebook_scraper\facebook_scraper.py", line 925, in get
    raise exceptions.NotFound(title.text)
facebook_scraper.exceptions.NotFound: Content Not Found
(fb)

Why is this? Is there something differnt with this site? Or do i have to use here other parameters / or cookie settings?

Rapid1898-code avatar Sep 29 '22 21:09 Rapid1898-code

ParkHyattMendoza seems a page to me, not a profile. You can try with get_page_info.

Ianneee avatar Sep 30 '22 20:09 Ianneee

Hello - thanks for your response - I heard from "get_page_info" the first time - is there somewhere a documentation i am missing?

However i tried to run it with this code:

erg = get_page_info("ParkHyattMendoza", cookies="cookie.txt")
print(erg)
for k,v in erg.items():
  print(f"\n{k}: {v}")  

No error - but it simply outputs a empty dict. Is there any way to the the profile / page information for this site?

Rapid1898-code avatar Oct 01 '22 20:10 Rapid1898-code

I'm also trying to get page info and for most of the pages, it returns an empty dictionary.
For other pages, it returns only a dict with the name.

igorkf avatar Dec 28 '22 15:12 igorkf

Same here. Is there an option to get page info (e.g., creation date, categories, description, etc)?

estebanpdl avatar Mar 24 '23 16:03 estebanpdl