← Back to All Patterns

Age Gate Pattern

Age verification gates commonly found on adult content and age-restricted sites

Checkbox Variant
Easy
Simple "I am 18+" checkbox with optional "remember me" cookie persistence

Scraper Challenges:

  • Detect checkbox element
  • Submit form programmatically
  • Handle cookie persistence
/patterns/age-gate/checkbox
Test This Variant
Date of Birth
Medium
Enter actual birthdate - calculates age and validates 18+ requirement

Scraper Challenges:

  • Handle date input field
  • Calculate valid 18+ date
  • Handle age validation errors
/patterns/age-gate/dob
Test This Variant
Overlay Modal
Easy
Modal popup overlay that blocks background content (blurred/grayed out)

Scraper Challenges:

  • Detect modal overlay (z-index)
  • Access blocked background content
  • Dismiss modal programmatically
/patterns/age-gate/overlay
Test This Variant
Pattern Information
How to test age gates with your scraping tools

Real-World Examples:

  • Adult content sites (Pornhub, OnlyFans, adult entertainment)
  • Alcohol and tobacco websites (breweries, wine shops)
  • Cannabis retail sites (dispensaries in legal markets)
  • Mature gaming content (age-restricted games)

Common Testing Approaches:

  • Puppeteer/Playwright: Use page.click() and page.fill() to interact with forms
  • HTTP Clients: Submit form data directly, then save cookies for subsequent requests
  • Cookie Bypass: Set age_verified=true cookie before first request

Note: These patterns simulate real-world age gates for testing purposes. When scraping production sites, always respect their terms of service and robots.txt directives.