How to set up Apify Proxy correctly with native Puppeteer?
Hi guys, I want to use Apify Proxy with native Puppeteer JS. Is this the correct setup? Thanks in advance!
INPUT SCHEMA:
"proxyConfiguration": {
"title": "Proxy configuration",
"type": "object",
"description": "Select proxies to be used.",
"prefill": {
"useApifyProxy": true,
"apifyProxyGroups": [],
"country": ""
},
"editor": "proxy"
}
MAIN.JS:
const input = await Actor.getInput();
const { proxyConfiguration } = input;
const browser = await puppeteer.launch({
headless: "new",
proxy: proxyConfiguration
});
2 Replies
@blitzkrieg just advanced to level 3! Thanks for your contributions! 🎉
exotic-emerald•14mo ago
Hi @blitzkrieg,
the proxy configuration input as you posted is used in our SDK crawlee.
As you are directly using puppeteer, you need to set the proxy in a different way. You can refer for example to this example: https://docs.apify.com/academy/puppeteer-playwright/proxies
V - Using proxies | Academy | Apify Documentation
Understand how to use proxies in your Puppeteer and Playwright requests, as well as a couple of the most common use cases for proxies.