How to Set Up a puppeteer proxyserver socks5h for Web Scraping? or Best Practices for Using puppeteer

14 Replies, 1130 Views

Pro tip: Use `socks-proxy-agent` package if native puppeteer proxyserver socks5h fails. Works like a charm:

```
const SocksProxyAgent = require('socks-proxy-agent');
const agent = new SocksProxyAgent('socks5h://user:pass@ip:port');

const browser = await puppeteer.launch({
args: [`--proxy-server=${agent.proxy.host}`]
});
```

If that doesn’t work, your proxy might be dead or blocking puppeteer’s traffic.

Messages In This Thread



Users browsing this thread: 1 Guest(s)