Skip to content

Commit 4b28144

Browse files
committed
Fixing the functions-based filtering logic
1 parent 6b62579 commit 4b28144

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scrapling/parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,9 @@ def _search_tree(element: Adaptor, filter_function: Callable) -> None:
633633
for pattern in patterns:
634634
results.extend(self.find_by_regex(pattern, first_match=False))
635635

636-
for function in functions:
637-
_search_tree(self, function)
636+
for result in (results or [self]):
637+
for function in functions:
638+
_search_tree(result, function)
638639

639640
return self.__convert_results(results)
640641

0 commit comments

Comments
 (0)