From f614651a979146b170331e9eeebb11e33316f2a2 Mon Sep 17 00:00:00 2001 From: Karim shoair Date: Wed, 1 Apr 2026 17:36:35 +0200 Subject: [PATCH] fix(Proxy Rotation): Fix an MRO issue The stub shadows the real implementation, and proxy rotation always hits NotImplementedError. Possible fix for #215 Co-Authored-By: Yuval Dinodia <102706514+yetval@users.noreply.github.com> --- scrapling/engines/_browsers/_base.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scrapling/engines/_browsers/_base.py b/scrapling/engines/_browsers/_base.py index 16a995d..eefb9f3 100644 --- a/scrapling/engines/_browsers/_base.py +++ b/scrapling/engines/_browsers/_base.py @@ -48,9 +48,8 @@ from scrapling.engines.constants import STEALTH_ARGS, HARMFUL_ARGS, DEFAULT_ARGS class SyncSession: _config: "PlaywrightConfig | StealthConfig" _context_options: Dict[str, Any] - - def _build_context_with_proxy(self, proxy: Optional[ProxyType] = None) -> Dict[str, Any]: - raise NotImplementedError # pragma: no cover + if TYPE_CHECKING: + _build_context_with_proxy: Callable[..., Dict[str, Any]] def __init__(self, max_pages: int = 1): self.max_pages = max_pages @@ -216,9 +215,8 @@ class SyncSession: class AsyncSession: _config: "PlaywrightConfig | StealthConfig" _context_options: Dict[str, Any] - - def _build_context_with_proxy(self, proxy: Optional[ProxyType] = None) -> Dict[str, Any]: - raise NotImplementedError # pragma: no cover + if TYPE_CHECKING: + _build_context_with_proxy: Callable[..., Dict[str, Any]] def __init__(self, max_pages: int = 1): self.max_pages = max_pages