kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.4k stars 628 forks source link

get_profile - IndexError: list index out of range #450

Open milesgratz opened 3 years ago

milesgratz commented 3 years ago

Hey there - I'm getting this error for a particular user! Will attempt to fix it myself and comment on here with the fix, if possible.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/fbscraping/venv-original/lib/python3.8/site-packages/facebook_scraper/__init__.py", line 69, in get_profile
    return _scraper.get_profile(account, **kwargs)
  File "/opt/fbscraping/venv-original/lib/python3.8/site-packages/facebook_scraper/facebook_scraper.py", line 199, in get_profile
    profile_photo = photo_links[1]
IndexError: list index out of range

image

neon-ninja commented 3 years ago

I already fixed this in https://github.com/kevinzg/facebook-scraper/commit/fe6d504cfce0d5bc782537b2819b4379e3e53bb1 - try update to latest master