Skip to content

🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev

fix(Texthandler): Replace `get_all` with `getall` to match the `Selector` class

Karim shoair136c38978796
diff --git a/scrapling/core/custom_types.py b/scrapling/core/custom_types.py
index d06ac29..53255be 100644
--- a/scrapling/core/custom_types.py
+++ b/scrapling/core/custom_types.py
@@ -112,10 +112,10 @@ class TextHandler(str):
def get(self, default=None): # pragma: no cover
return self
- def get_all(self): # pragma: no cover
+ def getall(self): # pragma: no cover
return self
- extract = get_all
+ extract = getall
extract_first = get
def json(self) -> Dict:
@@ -279,7 +279,7 @@ class TextHandlers(List[TextHandler]):
return self
extract_first = get
- get_all = extract
+ getall = extract
class AttributesHandler(Mapping[str, _TextHandlerType]):
diff --git a/tests/parser/test_parser_advanced.py b/tests/parser/test_parser_advanced.py
index 969ccc3..39829bb 100644
--- a/tests/parser/test_parser_advanced.py
+++ b/tests/parser/test_parser_advanced.py
@@ -357,7 +357,7 @@ class TestTextHandlerAdvanced:
"""Test TextHandlers.extract() returns self"""
handlers = TextHandlers([TextHandler("a"), TextHandler("b")])
assert handlers.extract() is handlers
- assert handlers.get_all() is handlers
+ assert handlers.getall() is handlers
class TestSelectorsAdvanced: