main.py
logging works as expected, however in routes.py
logging is printed twice for some reason.Actor.log.info("STARTING A NEW CRAWL JOB")
[apify] INFO Checking item 17 [apify] INFO Checking item 17 ({"message": "Checking item 17"}) [apify] INFO Processing new item with index: 17 [apify] INFO Processing new item with index: 17 ({"message": "Processing new item with index: 17"})
main.py
(https://docs.apify.com/sdk/python/docs/concepts/logging) async def main() -> None: async with Actor: ##### SETUP LOGGING ##### handler = logging.StreamHandler() handler.setFormatter(ActorLogFormatter()) apify_logger = logging.getLogger('apify') apify_logger.setLevel(logging.DEBUG) apify_logger.addHandler(handler)
main.py
2x, and everything from routes.py
3x.[apify] INFO STARTING A NEW CRAWL JOB [apify] INFO STARTING A NEW CRAWL JOB ({"message": "STARTING A NEW CRAWL JOB"}) [apify] INFO STARTING A NEW CRAWL JOB ({"message": "STARTING A NEW CRAWL JOB"})
WARN
, which spawns another playwright instance. finished condition
is met.[crawlee.storages._request_queue] WARN The request queue seems to be stuck for 300.0s, resetting internal state. ({"queue_head_ids_pending": 0, "in_progress": ["tEyKIytjmqjtRvA"]})
max_results = 5 # example crawler = PlaywrightCrawler( headless=False, request_handler=router, ) await crawler.run([start_url])
@router.default_handler async def default_handler(context: PlaywrightCrawlingContext) -> None: max_results = ???