Correcting return type for css_first and xpath_first

This commit is contained in:
Karim shoair
2024-11-06 12:28:43 +02:00
parent e4eb442709
commit 5548941cf1
+2 -2
View File
@@ -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: