Skip to content

Commit b400482

Browse files
committed
Create correct statistics for AdaptivePlaywrightCrawler on initialization with a custom parser
1 parent 54b6b0f commit b400482

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)