diff --git a/src/scout_logic.py b/src/scout_logic.py index fc8e5d7..3cd77ac 100644 --- a/src/scout_logic.py +++ b/src/scout_logic.py @@ -9,7 +9,7 @@ from urllib.parse import urlparse import httpx from playwright.async_api import async_playwright -from playwright_stealth.stealth import stealth_async +from playwright_stealth import Stealth # OpenRouter Base-URL und Modell OPENROUTER_BASE = "https://openrouter.ai/api/v1" @@ -76,9 +76,9 @@ async def _fetch_links_impl(domain: str, disable_http2: bool = False) -> list[di viewport=VIEWPORT, java_script_enabled=True, ) + # Stealth auf Kontext anwenden (API 2.x: apply_stealth_async(context)) + await Stealth().apply_stealth_async(context) page = await context.new_page() - # Stealth – entscheidend gegen extreme Bot-Detection - await stealth_async(page) # Versuch 1: Direkt zur Zielseite (z. B. https://www.mckinsey.com/featured-insights) try: