From 5548941cf1d154051d3edb2bac13129c80e7763f Mon Sep 17 00:00:00 2001 From: Karim shoair Date: Wed, 6 Nov 2024 12:28:43 +0200 Subject: [PATCH] Correcting return type for `css_first` and `xpath_first` --- scrapling/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scrapling/parser.py b/scrapling/parser.py index 4f994b4..52d9bcf 100644 --- a/scrapling/parser.py +++ b/scrapling/parser.py @@ -396,7 +396,7 @@ class Adaptor(SelectorsGeneration): def css_first(self, selector: str, identifier: str = '', auto_match: bool = False, auto_save: bool = False, percentage: int = 0 - ) -> Union['Adaptors[Adaptor]', List, None]: + ) -> Union['Adaptor', 'TextHandler', None]: """Search current tree with CSS3 selectors and return the first result if possible, otherwise return `None` **Important: @@ -421,7 +421,7 @@ class Adaptor(SelectorsGeneration): def xpath_first(self, selector: str, identifier: str = '', auto_match: bool = False, auto_save: bool = False, percentage: int = 0, **kwargs: Any - ) -> Union['Adaptors[Adaptor]', List, None]: + ) -> Union['Adaptor', 'TextHandler', None]: """Search current tree with XPath selectors and return the first result if possible, otherwise return `None` **Important: