FAcebook Ads library src video/images
Hi everyone,
I'm building a scraper using Apify for the Facebook Ads Library. I'm fetching ad data via the Ads Library API, which provides details including an ad_snapshot_url. The issue is that the direct URL for the ad creative (the image or video file) is not included in the API response.
My approach is to open the ad_snapshot_url with Playwright and attempt to extract the <img> or <video> element from the DOM.
However, Facebook detects this and blocks my attempt. The page doesn't load correctly, and the target element is missing from the DOM structure.
What is the most effective way to bypass this block and get the direct URL for the creative? Are there any established best practices for using Playwright in this scenario, or is there an alternative method to get this URL?
Thanks for any advice. @Helper
1 Reply
Browser is not necessary, see https://apify.com/apify/facebook-ads-scraper - by running browser you probably running anti-bot, so solution is to use cheerio or http scraper
Apify
📢 Facebook Ads Scraper · Apify
Scrape Facebook ads from any Facebook page. Download reach estimates, impressions, publisher platforms, ad IDs, and more in Excel, CSV, JSON.