(context: BeautifulSoupCrawlingContext)
| 9 | |
| 10 | @crawler.router.default_handler |
| 11 | async def request_handler(context: BeautifulSoupCrawlingContext) -> None: |
| 12 | context.log.info(f'Processing {context.request.url}.') |
| 13 | |
| 14 | # Enqueue links that match the 'include' glob pattern and |
| 15 | # do not match the 'exclude' glob pattern. |
| 16 | # highlight-next-line |
| 17 | await context.enqueue_links( |
| 18 | # highlight-next-line |
| 19 | include=[Glob('https://someplace.com/**/cats')], |
| 20 | # highlight-next-line |
| 21 | exclude=[Glob('https://**/archive/**')], |
| 22 | # highlight-next-line |
| 23 | ) |
| 24 | |
| 25 | await crawler.run(['https://crawlee.dev/']) |
| 26 |
nothing calls this directly
no test coverage detected