@@ -52,12 +52,12 @@ def fetch(cls, url: str, **kwargs: Unpack[PlaywrightSession]) -> Response:
5252 - additional_args: Additional arguments to be passed to Playwright's context as additional settings.
5353 :return: A `Response` object.
5454 """
55- # Get selector_config from kwargs if provided, otherwise use empty dict
56- selector_config = kwargs .get ("selector_config" , {})
55+ selector_config = kwargs .get ("selector_config" , {}) or kwargs .get (
56+ "custom_config" , {}
57+ ) # Checking `custom_config` for backward compatibility
5758 if not isinstance (selector_config , dict ):
5859 raise TypeError ("Argument `selector_config` must be a dictionary." )
5960
60- # Merge selector_config with class defaults
6161 kwargs ["selector_config" ] = {** cls ._generate_parser_arguments (), ** selector_config }
6262
6363 with DynamicSession (** kwargs ) as session :
@@ -95,12 +95,12 @@ async def async_fetch(cls, url: str, **kwargs: Unpack[PlaywrightSession]) -> Res
9595 - additional_args: Additional arguments to be passed to Playwright's context as additional settings.
9696 :return: A `Response` object.
9797 """
98- # Get selector_config from kwargs if provided, otherwise use empty dict
99- selector_config = kwargs .get ("selector_config" , {})
98+ selector_config = kwargs .get ("selector_config" , {}) or kwargs .get (
99+ "custom_config" , {}
100+ ) # Checking `custom_config` for backward compatibility
100101 if not isinstance (selector_config , dict ):
101102 raise TypeError ("Argument `selector_config` must be a dictionary." )
102103
103- # Merge selector_config with class defaults
104104 kwargs ["selector_config" ] = {** cls ._generate_parser_arguments (), ** selector_config }
105105
106106 async with AsyncDynamicSession (** kwargs ) as session :
0 commit comments