Skip to content

Commit bff7260

Browse files
authored
fix: Create correct statistics for AdaptivePlaywrightCrawler on initialization with a custom parser (#1637)
### Description - Create correct statistics for `AdaptivePlaywrightCrawler` on initialization with a custom parser without classmethods like `with_beautifulsoup_static_parser` and `with_parsel_static_parser`. ### Issues - Closes: #1630
1 parent 809f089 commit bff7260

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/crawlee/crawlers/_adaptive_playwright/_adaptive_playwright_crawler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ def __init__(
157157
if 'concurrency_settings' not in kwargs or kwargs['concurrency_settings'] is None:
158158
kwargs['concurrency_settings'] = ConcurrencySettings(desired_concurrency=1)
159159

160-
super().__init__(statistics=statistics, **kwargs)
160+
adaptive_statistics = statistics or Statistics(state_model=AdaptivePlaywrightCrawlerStatisticState)
161+
162+
super().__init__(statistics=adaptive_statistics, **kwargs)
161163

162164
# Sub crawlers related.
163165
playwright_crawler_specific_kwargs = playwright_crawler_specific_kwargs or {}

0 commit comments

Comments
 (0)