wait
parameter to your request, ZenRows pauses for the specified duration (in milliseconds) after the page initially loads, ensuring that slow-loading elements, animations, and dynamically generated content have time to appear before the HTML is extracted. The maximum wait
value acceptable is 30 seconds (30,000 milliseconds).
The Wait parameter requires
js_render=true
to function, as it operates within the browser environment during JavaScript rendering.How the Wait parameter works
The Wait parameter creates a pause in the scraping process after the initial page load completes. During this waiting period, the headless browser remains active, allowing JavaScript to continue executing, AJAX requests to complete, and dynamic content to render. This process ensures you capture:- Content loaded through delayed AJAX calls
- Elements that appear after animations complete
- Data populated by slow third-party APIs
- Progressive loading sequences
- Time-sensitive dynamic updates
Basic usage
Add thewait
parameter with a value in milliseconds to your JavaScript rendering request:
When to use the Wait parameter
The Wait parameter is essential in these scenarios:Content loading delays:
- Slow API responses - Pages that fetch data from slow external APIs
- Progressive content loading - Sites that load content in multiple stages
- Heavy JavaScript processing - Pages with complex calculations or data processing
- Third-party widgets - External content like maps, charts, or embedded media
- Animation sequences - Content that appears after CSS or JavaScript animations
Timing-dependent content:
- Real-time data - Stock prices, live scores, or updating counters
- Lazy loading - Images or content that loads as needed
- Scroll preparation - Initial content that loads before scroll triggers
- Form validation - Dynamic form elements that appear based on user input simulation
Best practices
Start with reasonable defaults
Begin with moderate wait times and adjust based on results:Python
Combine with other parameters for maximum effectiveness
Use Wait with Premium Proxy for protected sites:Python
Troubleshooting
Common issues and solutions
Issue | Cause | Solution |
---|---|---|
Content still missing | Wait time too short | Increase wait duration incrementally |
Inconsistent results | Variable loading times | Use longer wait time, use wait_for , or implement retry logic |
REQS004 | Invalid value provided for wait parameter; value is too big (REQS004) | Keep wait under 30 seconds total or use wait_for |
Unnecessary delays | Fixed wait for fast-loading content | Use wait_for parameter for dynamic waiting |
Debugging missing content with Wait
When content is still missing despite using the Wait parameter:1
Check browser behavior manually
- Compare with manual browser testing
- Open the page in a browser and time how long content takes to appear
- Use that timing as your baseline wait duration
2
Increase wait time gradually
Python
3
Switch to the element-specific waiting (`wait_for`)
Python
See more on Wait_for documentation page
Understanding wait time limits
ZenRows has built-in limits for wait times to ensure service stability:- Maximum total wait time: 30 seconds (30,000 milliseconds)
- Recommended range: 2,000 - 10,000 milliseconds (2-10 seconds)
- Minimum practical wait: 1,000 milliseconds (1 second). Values below that are acceptable but impractical
Pricing
Thewait
parameter doesn’t increase the request cost. You pay the JavaScript Render (5 times the standard price) regardless of the wait value you choose.
Frequently Asked Questions (FAQ)
What's the difference between wait and wait_for parameters?
What's the difference between wait and wait_for parameters?
The
wait
parameter introduces a fixed delay in milliseconds, while wait_for
waits for a specific element to appear on the page. Use wait
when you know content takes a particular amount of time to load, and wait_for
when you want to wait for specific elements to appear.Can I use wait without js_render=true?
Can I use wait without js_render=true?
No, the
wait
parameter only works with JavaScript rendering enabled. Without js_render=true
, the wait parameter will be ignored since there’s no browser environment to pause within.How do I know if my wait time is too short or too long?
How do I know if my wait time is too short or too long?
Test different wait times and monitor content length, as well as the presence of target elements. If content is missing, increase the wait time. If you’re getting complete content with shorter waits, you can reduce the time to improve efficiency.
Should I use the same wait time for all pages on a website?
Should I use the same wait time for all pages on a website?
Not necessarily. Different pages may have different loading characteristics. Product pages may require longer wait times than category pages. Consider implementing adaptive wait times based on page type or previous successful timings.
Can I use wait with other features?
Can I use wait with other features?
Yes, the
wait
parameter works perfectly with any other feature.What happens if I use both wait and wait_for?
What happens if I use both wait and wait_for?
When using both
wait
and wait_for
, the wait_for
parameter takes precedence and overrides the wait
parameter.