To prevent 403 errors caused by TLS fingerprinting, request throttling, or concurrent request conflicts, use the following configuration when calling cloudscraper.create_scraper().
Critical Settings for Stability:
min_request_interval: Set to 2.0 or higher to prevent TLS blocking.max_concurrent_requests: Set to 1 to prevent concurrent TLS conflicts.rotate_tls_ciphers: Set to True to avoid detection via cipher suite patterns.auto_refresh_on_403: Set to True to enable automatic recovery from 403 errors.
import cloudscraper
# OPTIMAL CONFIGURATION for preventing your specific 403 issues
scraper = cloudscraper.create_scraper(
debug=True, # Enable for monitoring (disable in production)
# 🔑 KEY SETTINGS to prevent 403 errors
min_request_interval=2.0, # CRITICAL: Prevents TLS blocking
max_concurrent_requests=1, # CRITICAL: Prevents concurrent conflicts
rotate_tls_ciphers=True, # CRITICAL: Avoids cipher detection
# 🛡️ Enhanced protection
auto_refresh_on_403=True, # Auto-recover from 403 errors
max_403_retries=3, # Max retry attempts
session_refresh_interval=1800, # Refresh session every 30 minutes
# 🥷 Optimized stealth mode
enable_stealth=True,
stealth_options={
'min_delay': 1.0, # Reasonable delays
'max_delay': 3.0,
'human_like_delays': True,
'randomize_headers': True,
'browser_quirks': True
}
)
response = scraper.get('https://your-target-site.com')