Apify Discord Mirror

If i use multiple files, what is the best way to pass data (user input, which contains 'max_results' or something) to my routes.py?

example snippet main.py
Plain Text
        max_results = 5 # example

        crawler = PlaywrightCrawler(
            headless=False, 
            request_handler=router,
        )
        await crawler.run([start_url])


snippet routes.py
Plain Text
@router.default_handler
async def default_handler(context: PlaywrightCrawlingContext) -> None:
    max_results = ???
3 comments
D
M
В