Sign up for Apify Platform here
Star Crawlee on GitHub
Star Crawlee for Python on GitHub
Apify and Crawlee Official Forum
New post
View all posts
Related posts
Did this answer your question?
๐
๐
๐
Powered by
Hall
Inactive
Updated 4 months ago
0
Follow
How to set the delay between requests?
How to set the delay between requests?
Inactive
0
Follow
C
C-Weed
4 months ago
ยท
crawler = PlaywrightCrawler(
max_requests_per_crawl=10,
max_request_retries=0,
headless=True,
browser_type='chromium',
)
I want to set 3600ms delay between requests
E
1 comment
Share
Open in Discord
E
Exp
4 months ago
Hi, please refer this code
import asyncio
from apify import PlaywrightCrawler
async def handle_page_function(page, request):
# Your page processing logic here
print(f'Processing {request.url}')
# Introduce a delay of 3600ms (3.6 seconds)
await asyncio.sleep(3.6)
crawler = PlaywrightCrawler(
max_requests_per_crawl=10,
max_request_retries=0,
headless=True,
browser_type='chromium',
request_handler=handle_page_function, # Attach the handler function
)
Start the crawler
crawler.run()
Add a reply
Sign up and join the conversation on Discord
Join on Discord