fix: save context state in result for `AdaptivePlaywrightCrawler` after isolated processing in `SubCrawler` by Mantisus · Pull Request #1488 · apify/crawlee-python

@Mantisus

Description

  • save context state in result for AdaptivePlaywrightCrawler after isolated processing in SubCrawler

Issues

@Mantisus

@Mantisus Mantisus changed the title fixL save context state in result for AdaptivePlaywrightCrawler after isolated processing in SubCrawler fix: save context state in result for AdaptivePlaywrightCrawler after isolated processing in SubCrawler

Oct 15, 2025

@Pijukatel

Please add the test that will cover the reported issue.

@Mantisus

@Mantisus

Please add the test that will cover the reported issue.

Added

Pijukatel

janbuchar

@Mantisus

@Mantisus

@Mantisus

janbuchar

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

context.log.debug(f'Detected rendering type {detection_result} for {context.request.url}')
self.rendering_type_predictor.store_result(context.request, detection_result)

self._update_context_from_copy(context, pw_run.run_context)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should make the changes made to the context part of the RequestHandlerResult data structure at some point. What do you think @Mantisus @Pijukatel?

No need to stall this PR because of that, it can be done later.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.