Use Case Overview
Code Recipes
1. Search for products using the search form
This example shows how to automatically fill and submit a search form, then wait for the search results to load.Python
js_instructions parameter fills the search field with “hoodie”, clicks the search button, and waits for the main content area to load with search results before returning the content.
2. Keep the Same IP Across Requests
Use the samesession_id value to route multiple requests through the same IP for up to 10 minutes. session_id does not store cookies or other request data: read cookies from the Zr--prefixed response headers and send them back yourself on the next request if the flow needs them.
Python
Add
session_id only to the requests that must share an IP, such as a login step followed by an authenticated page. On a protected site, a blocked IP makes every retry on that session fail the same way, so if a request comes back blocked, retry with a new session_id value instead of reusing the blocked one. Leave session_id off requests that don’t need IP continuity.3. Extract Specific Fields Only
Instead of getting the full HTML, extract only the data you need using CSS selectors.Python
JSON
4. Scrape Localized Content
Access geo-restricted content or get localized pricing by routing your request through specific countries.Python
5. Debugging a Blocked Request
When requests fail, use these parameters to understand what’s happening without losing the response data.Check the actual HTTP status
Use theoriginal_status parameter to see the real HTTP status code the target page returns.
Python
Allow specific error status codes
Use theallowed_status_codes parameter to receive the actual HTML content even when the page returns error status codes.
Python
Add custom headers
Use custom headers to simulate browser behavior for more reliable access.Python
What’s Next
Ready to implement these recipes? Here are your next steps:- Explore the Parameter Reference
- Follow the First Request Guide
- Jump back to Welcome