import os from pathlib import Path class Config: """Application Configuration""" # Base directories BASE_DIR = Path(__file__).parent.parent.parent.parent OUTPUT_DIR = BASE_DIR / 'output' SCREENSHOTS_DIR = OUTPUT_DIR / 'screenshots' # Data files DATA_FILE = OUTPUT_DIR / 'data.jsonl' # Parser settings TIMEOUT_MS = 60000 SCROLL_DELAY = 2000 MAX_NO_CHANGE_COUNT = 3 # User Agents USER_AGENTS = [ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" ] # Screenshot settings SCREENSHOT_VIEWPORT = {'width': 1920, 'height': 1080} SCREENSHOT_WAIT_TIME = 3000 # Cloudflare bypass CLOUDFLARE_WAIT_TIME = 5000 CLOUDFLARE_INDICATORS = [ "Verify you are human", "Checking your browser before accessing", "Just a moment..." ] def __init__(self): # Create necessary directories self.OUTPUT_DIR.mkdir(exist_ok=True) self.SCREENSHOTS_DIR.mkdir(exist_ok=True)