From 9a0585c8f623ae9a65e3a96c4893c1cf63af0b2e Mon Sep 17 00:00:00 2001 From: RoyLeviLangware <163380355+RoyLeviLangware@users.noreply.github.com> Date: Tue, 6 May 2025 11:44:48 +0300 Subject: [PATCH] fix bs4 warning on text kwarg - switch to string Fix warning as proposed by bs4: ``` .../bs4/element.py:2253: DeprecationWarning: The 'text' argument to find()-type methods is deprecated. Use 'string' instead. return self.find_all( ``` --- crawl4ai/content_filter_strategy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl4ai/content_filter_strategy.py b/crawl4ai/content_filter_strategy.py index 4102cbad..75b8ff7f 100644 --- a/crawl4ai/content_filter_strategy.py +++ b/crawl4ai/content_filter_strategy.py @@ -656,7 +656,7 @@ class PruningContentFilter(RelevantContentFilter): def _remove_comments(self, soup): """Removes HTML comments""" - for element in soup(text=lambda text: isinstance(text, Comment)): + for element in soup(string=lambda string: isinstance(string, Comment)): element.extract() def _remove_unwanted_tags(self, soup):