From d66ebc19a560a9003f94c03309a6f4e133258dc3 Mon Sep 17 00:00:00 2001 From: Karim shoair Date: Mon, 16 Dec 2024 12:35:25 +0200 Subject: [PATCH] fix(Fetchers/disable_resources): Fixing the logic for intercepting resources --- scrapling/engines/toolbelt/navigation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scrapling/engines/toolbelt/navigation.py b/scrapling/engines/toolbelt/navigation.py index 0a9ff86..14a26d0 100644 --- a/scrapling/engines/toolbelt/navigation.py +++ b/scrapling/engines/toolbelt/navigation.py @@ -21,7 +21,8 @@ def intercept_route(route: Route): if route.request.resource_type in DEFAULT_DISABLED_RESOURCES: log.debug(f'Blocking background resource "{route.request.url}" of type "{route.request.resource_type}"') route.abort() - route.continue_() + else: + route.continue_() async def async_intercept_route(route: async_Route): @@ -33,7 +34,8 @@ async def async_intercept_route(route: async_Route): if route.request.resource_type in DEFAULT_DISABLED_RESOURCES: log.debug(f'Blocking background resource "{route.request.url}" of type "{route.request.resource_type}"') await route.abort() - await route.continue_() + else: + await route.continue_() def construct_proxy_dict(proxy_string: Union[str, Dict[str, str]]) -> Union[Dict, None]: