DEV Community

Discussion on: Practical Puppeteer: Using proxy to browse a page

Collapse
 
princepeterhansen profile image
Peter Hansen

Hi Sony,

Cool Article!

I have also been looking for a proxy solution when using Puppeteer. One of the easiest solutions I found is using API proxy services. You don't have to worry about finding and setting up proxies.

The basic example will look like this:

import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();

  const url = 'https://proxybot.io/api/......?url=https://example.com';

  await page.goto(url);
})();
Enter fullscreen mode Exit fullscreen mode

What do you think?

Collapse
 
sonyarianto profile image
Sony AK

Hi Peter,
Thanks, this is also good way and reduce headache for setting up a proxy :) Thanks for the addition.