Configure Scrapy Playwright for Proxidize
Scrapy Playwright renders selected Scrapy requests in a browser. Its proxy belongs on the Playwright browser context because browser requests do not use Scrapy's ordinary request-level proxy metadata.
Keep the endpoint and credentials in environment variables. Use the exact HTTP or HTTPS scheme shown in the Proxidize dashboard.
Run the Integration
Install the extended requirements and the Chromium browser. Keep static requests on Scrapy's ordinary downloader and mark only requests that need browser rendering.
Proxidize browser context
Create a named context with separate server and authentication fields, then select that context in the request metadata.
Control Sessions and Rotation
Use a distinct Playwright context for each sticky proxy identity. Limit pages per context and close contexts on success and failure; leaving pages open can exhaust browser resources before the crawler reaches its request limit.
Use a sticky session when related requests must keep the same temporary network identity. Use rotation for independent requests, and rotate only at an intentional workflow boundary. Cookies, browser storage, and application state should change with the proxy identity rather than halfway through a stateful task.
Verify the Proxied Network Path
Run the IP-check example through the same client or browser context that will perform the permitted workload. A successful request from another terminal or library does not prove that this integration uses the same proxy route.
The repository example prints a redacted endpoint and the visible exit IP. It does not print the username or password. Confirm the intended US mobile or residential profile before using an approved target.
Troubleshoot Common Failures
- Scrapy meta[proxy] does not configure browser-generated Playwright traffic; put the proxy on the browser context.
- Register the Scrapy Playwright download handlers and asyncio reactor before marked requests run.
- Limit concurrent contexts and pages separately from Scrapy's top-level request concurrency.
Test in layers: first verify the endpoint and credentials, then the IP-check URL, and only then the intended destination. Keep TLS verification enabled and treat repeated timeouts separately from authentication failures.
Production Checklist
- Keep credentials in environment variables or a secrets manager.
- Match one sticky session to one stateful worker or browser context.
- Bound concurrency, retries, queue length, and request rate.
- Redact proxy credentials from exceptions, traces, and logs.
- Verify the exit location and protocol before scaling.
- Follow applicable laws, third-party terms, and destination rules.