Answer Overflow
11/03/2025, 9:55 AMeric_20599
11/03/2025, 9:55 AMMantisus
11/03/2025, 10:32 AMHttpCrawler.
So you can use context.enqueue_links(selector=‘[selector for pdf links]’, rq_name=‘pdf_crawler’) in PlaywrightCrawler to pass the links to the HttpCrawler queue.
The pdf_crawler queue must be created in advance.eric_20599
11/03/2025, 11:42 AMMantisus
11/03/2025, 11:57 AMpython
import asyncio
from playwright.async_api import Error
from crawlee.crawlers import PlaywrightCrawler, PlaywrightCrawlingContext
async def main() -> None:
crawler = PlaywrightCrawler(
max_request_retries=1
)
@crawler.router.default_handler
async def request_handler(context: PlaywrightCrawlingContext) -> None:
context.log.info(f'Processing {context.request.url}')
await context.enqueue_links()
@crawler.error_handler
async def error_handler(context: PlaywrightCrawlingContext, error: Exception) -> None:
if isinstance(error, Error) and 'Download is starting' in error.message:
context.log.error(f'Error processing {context.request.url}')eric_20599
11/03/2025, 1:58 PM