查找WebDriver使用的代理服务器



我使用代理运行selenium WebDriver。

chrome_options.add_argument('--proxy-server="'94.242.58.108:1448'"
driver = Chrome(chrome_options=chrome_options)

驱动程序知道它现在使用的是哪个代理服务器。你能告诉我如何找到用过的代理服务器吗?

我在其他功能中需要这些信息。

请参阅java文档http://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/Proxy.html我们有getHttpProxy((来检索代理。

Proxy p=new Proxy(); // used at the start to set proxy and pass to chrome options and driver
System.out.println(p.getHttpProxy()); // to get proxy when required.

最新更新