How to add a proxy with auth to ChromeDriver on Watir

偶尔善良 提交于 2019-12-10 15:18:38

问题


I'm using Watir on Ruby which uses Selenium as its underlying framework. I'm using ChromeDriver, and to set up a proxy I sually did this:

b = Watir::Browser.new :chrome, :switches => ["--proxy-server=11.1.1.11:3011"]

Sometimes, the proxy comes with user,password authentication like this:

11.1.1.11:3011:3011:user:pass

but when I try to put that string into --proxy-server I get an error.

How can I configure ChromeDriver to use the authentication? I've tried the format often suggested in other SO answers which is:

http://user:pass@11.1.1.11:3011

but that didn't work. Tried it without the http part, also didn't work.

来源:https://stackoverflow.com/questions/41551234/how-to-add-a-proxy-with-auth-to-chromedriver-on-watir

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!