使用 Tor 运行 Puppeteer [英] Run Puppeteer with Tor

查看:59
本文介绍了使用 Tor 运行 Puppeteer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 Tor Expert Bundle,我想用 Puppeteer 运行它.

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

我尝试:

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

但我收到错误 ERR_NO_SUPPORTED_PROXIES.我可以用普通的 Chrome 浏览器运行它.

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

推荐答案

关于无头模式下更复杂的代理配置,Chrome 中存在一个已打开的错误 (来源).自 2017 年 7 月以来没有任何活动.

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.

但是,我已经能够使用无头铬和 SOCKS5 代理配置运行 Puppeteer (1.3.0).

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']});

尝试更新 Puppeteer,它也会更新捆绑的 Chromium,然后再次运行.似乎您可能还有一个错字:删除 socks5://127.0.0.1:9050 之间的 ".

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.

这篇关于使用 Tor 运行 Puppeteer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆