Enable Proxies
Overview
This guide shows you how to set up and use proxies with Playwright and AgentQL to avoid bot detection.
What's a proxy
A proxy is a server that acts as an intermediary between your browser and the website you are trying to access. You can use different types of proxies such as residential proxies, data center proxies, and mobile proxies.
When should you use a proxy
There are many scenarios where you might want to use a proxy:
- Bypass geo-restrictions
- Access blocked websites in your country
- Hide your IP address
- Bypass rate limits
- Bypass bot detection
How to use a proxy with Playwright
You can set the proxy configuration with Playwright. You can use a HTTP(S) or SOCKS5 proxy with Playwright.
You'll need to replace YOUR_PROXY_SERVER
, YOUR_PROXY_USERNAME
, and YOUR_PROXY_PASSWORD
with your actual proxy details.
The proxy
argument within the playwright.chromium.launch()
function is responsible for establishing the proxy configuration, which includes the proxy server URL along with the port, and the credentials necessary for authentication.
To learn more about proxies with Playwright, see Playwright Proxy.
Conclusion
In this guide, you learned how to set up and use proxies with Playwright while integrating it with AgentQL. Using proxies is a common way to avoid bot detection.