website:
  name: Redbubble Marketplace
  base_url: https://www.redbubble.com
  type: redbubble

crawling:
  start_urls:
  - https://www.redbubble.com/shop/funny+gardening+t-shirts
  pagination:
    enabled: true
    selector: a[rel="next"], .pagination a.next, a[aria-label*="next"], button[aria-label*="next"]
    max_pages: 50
  follow_links: true

selectors:
  # Redbubble product containers
  product_container: '[data-testid*="product"], [class*="ProductTile"], [class*="product-tile"], article[class*="product"], .product-item, a[href*="/products/"]'
  
  # Product title - usually in link or heading
  title: 'h2, h3, [class*="title"], [class*="Title"], a[href*="/products/"] span, .product-title'
  
  # Price - Redbubble shows price ranges
  price: '[class*="price"], [class*="Price"], [data-testid*="price"], .price-range, span[class*="money"]'
  
  # Product image
  image: 'img[src*="redbubble"], img[alt*="product"], [class*="product-image"] img, [class*="ProductImage"] img'
  
  # Product link
  link: 'a[href*="/products/"]'
  
  # Description - usually on product detail page
  description: '[class*="description"], [class*="Description"], [data-testid*="description"], .product-description'
  
  # Category/Collection - from URL or breadcrumb
  category: '[class*="breadcrumb"] a:last-child, [class*="category"], [class*="Collection"]'
  
  # SKU - usually in URL or data attributes
  sku: '[data-product-id], [data-sku], [data-testid*="product-id"], [itemprop="sku"]'
  
  # Attributes - product type, size options (on detail page)
  attributes: '[class*="attributes"], [class*="product-options"], [data-testid*="attributes"]'

rate_limiting:
  delay: 5.0
  download_delay: 5.0
  concurrent_requests: 1

headers:
  User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8
  Accept-Language: en-US,en;q=0.9
  Accept-Encoding: gzip, deflate, br
  Connection: keep-alive
  Upgrade-Insecure-Requests: '1'
  Sec-Fetch-Dest: document
  Sec-Fetch-Mode: navigate
  Sec-Fetch-Site: none
  Sec-Fetch-User: ?1

features:
  requires_javascript: true  # ⚠️ QUAN TRỌNG: Redbubble cần JavaScript để render
  api_endpoints: []
  custom_middleware: []

proxies:
  enabled: false
  list: []
  mode: rotate

notes: |
  Redbubble là một marketplace với Cloudflare protection.
  
  ⚠️ LƯU Ý QUAN TRỌNG:
  - Redbubble có Cloudflare protection, cần JavaScript để render
  - Có thể cần dùng Splash hoặc Playwright để render JavaScript
  - Redbubble nghiêm cấm scraping - chỉ crawl với mục đích hợp pháp
  - Rate limiting: delay tối thiểu 2 giây giữa các requests
  - Product URLs format: https://www.redbubble.com/shop/{collection-name} hoặc /products/{product-id}
  
  CẤU TRÚC:
  - Products được hiển thị trong grid layout
  - Mỗi product có link đến detail page: /products/{id}
  - Price thường là range (ví dụ: $20.00 - $30.00)
  - Images: multiple product images với different product types (t-shirt, sticker, poster, etc.)
  
  SELECTORS:
  - Product containers: [data-testid*="product"], [class*="ProductTile"]
  - Links: a[href*="/products/"]
  - Images: img[src*="redbubble"]
  
  PAGINATION:
  - Next button: a[rel="next"], button[aria-label*="next"]

export:
  domain_slug: redbubble-com
