Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Puppeteer with Tor

I installed the Tor Expert Bundle and I would like to run it with Puppeteer.

I try:

const browser = await puppeteer.launch({headless: false,args:['--proxy-server="socks5://127.0.0.1:9050"']});

But I get the error ERR_NO_SUPPORTED_PROXIES. I can run it with a normal Chrome browser.

like image 945
Giancarlo Ventura Avatar asked Nov 20 '17 22:11

Giancarlo Ventura


People also ask

Can I run puppeteer in browser?

To use Puppeteer with a different version of Chrome or Chromium, pass in the executable's path when creating a Browser instance: const browser = await puppeteer.launch({executablePath: '/path/to/Chrome'}); You can also use Puppeteer with Firefox Nightly (experimental support).

Does puppeteer work with Chrome?

Puppeteer is a Node library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome or Chromium.

What is puppeteer proxy?

Puppeteer Proxy Integration with Bright Data Puppeteer is a Node library created to control headless and non-headless Chrome and Chromium with its high-level API.


1 Answers

There's an opened bug in chromium regarding more complex configurations for proxy in headless mode (Source). There has not been any activity since July 2017.

However, I've been able to run Puppeteer (1.3.0) with a headless chromium and SOCKS5 proxy configuration.

const browser = await puppeteer.launch({args: ['--proxy-server=socks5://127.0.0.1:1337']});

Try updating Puppeteer, which also updates the bundled Chromium, and run again. Also seems like you might have a typo: remove the " between socks5://127.0.0.1:9050.

like image 126
David Salvador Avatar answered Sep 27 '22 21:09

David Salvador