Starts a headless Chrome browser session that will be reused by
get_ad_snapshots(), get_deeplink(), and get_ad_html() until
browser_session_close() is called.
Details
This significantly improves performance when processing multiple ads, as browser startup (~2–3 seconds) only happens once. By default the session is warmed up by navigating to the Facebook Ad Library landing page, which passes the JS challenge and sets cookies so that subsequent calls return data immediately.
Examples
if (FALSE) { # \dontrun{
# Start session (includes warm-up)
browser_session_start()
# Process multiple ads (each reuses the session)
results <- map_dfr_progress(ad_ids, ~get_ad_snapshots(.x))
# Close when done
browser_session_close()
} # }