🕷️ 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
Python aiai-scrapingautomationcrawlercrawlingcrawling-pythondatadata-extractionmcpmcp-serverplaywrightpythonscrapingselectorsstealthweb-scraperweb-scrapingweb-scraping-pythonwebscrapingxpath
fix(TextHandler): Fixing an issue with slicing
Karim shoaire9344a738409
diff --git a/scrapling/core/custom_types.py b/scrapling/core/custom_types.pyindex 30f61e1..67e4e00 100644--- a/scrapling/core/custom_types.py+++ b/scrapling/core/custom_types.py@@ -23,19 +23,8 @@ class TextHandler(str):return super().__new__(cls, string)return super().__new__(cls, '')- @typing.overload- def __getitem__(self, key: SupportsIndex) -> 'TextHandler':- pass-- @typing.overload- def __getitem__(self, key: slice) -> "TextHandlers":- pass-- def __getitem__(self, key: Union[SupportsIndex, slice]) -> Union["TextHandler", "TextHandlers"]:+ def __getitem__(self, key: Union[SupportsIndex, slice]) -> "TextHandler":lst = super().__getitem__(key)- if isinstance(key, slice):- lst = [TextHandler(s) for s in lst]- return TextHandlers(typing.cast(List[_TextHandlerType], lst))return typing.cast(_TextHandlerType, TextHandler(lst))def split(self, sep: str = None, maxsplit: SupportsIndex = -1) -> 'TextHandlers':