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

banned from facebook

Open avishayAv opened this issue 2 years ago • 5 comments

Hi, I reviewed your package and you said that - "If you scrape too much, Facebook might temporarily ban your IP."

I wanted to know if you are aware to an accurate policy? it seems like im banned without pulling a lot of data. i tried to use time.sleep to pull in a slower frequency and it didn't help as well.

the error i get : raise exceptions.TemporarilyBanned(title.text) facebook_scraper.exceptions.TemporarilyBanned: You’re Temporarily Blocked

what i'm trying to do - get_posts(group=fb_group, pages=5, credentials=credentials, options={"progress": True, "posts_per_page": 100}) when fb_group iterates about ~20 facebook groups.

any ideas how to do this?

thanks a lot!

avishayAv avatar Nov 10 '21 12:11 avishayAv

There's no one policy for all, it's more a trial an error process to figure out what rate works best for you - as there's variation based on access patterns, account, IP, etc. If you don't need high quality image links, you might want to try set the "allow_extra_requests": False option, as that would reduce the total number of requests made - reducing the time taken to scrape significantly and also reducing your risk of temp bans. Also I would consider 8000+ posts a lot of data. Scrapers use the same interface as a human would, and it's not reasonable for a human to read 8000 posts in the space of 10 minutes.

neon-ninja avatar Nov 10 '21 19:11 neon-ninja

What does "allow_extra_requests": True, will get?

fashan7 avatar Nov 11 '21 09:11 fashan7

allow_extra_requests allows "clicking" on a post to say, get the full post text, or reactions, or high quality images. With it disabled, the scraper will just "scroll down" on the main page, and not make any extra requests. Note that the scraper doesn't actually click or scroll, but performs the equivalent HTTP requests.

neon-ninja avatar Nov 11 '21 20:11 neon-ninja

How long do they usually block you for?

mkacki98 avatar May 15 '23 07:05 mkacki98