本文整理了Java中org.openqa.selenium.Proxy.setSocksPassword()
方法的一些代码示例,展示了Proxy.setSocksPassword()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Proxy.setSocksPassword()
方法的具体详情如下:
包路径:org.openqa.selenium.Proxy
类名称:Proxy
方法名:setSocksPassword
[英]Specifies a password for the SOCKS proxy. Supported by SOCKS v5 and above.
[中]指定SOCKS代理的密码。由SOCKS v5及以上版本支持。
代码示例来源:origin: org.seleniumhq.selenium/selenium-api
setSocksPassword((String) raw.get("socksPassword"));
代码示例来源:origin: com.infotel.seleniumRobot/core
public Proxy getProxy() {
ProxyConfig proxyConfig = getProxyConfig();
Proxy proxy = new Proxy();
proxy.setProxyType(proxyConfig.getType());
if (proxyConfig.getType() == ProxyType.PAC) {
proxy.setProxyAutoconfigUrl(proxyConfig.getPac());
// manual proxy configuration
} else if (proxyConfig.getType() == ProxyType.MANUAL) {
proxy.setHttpProxy(proxyConfig.getAddressAndPort());
proxy.setSslProxy(proxyConfig.getAddressAndPort());
proxy.setFtpProxy(proxyConfig.getAddressAndPort());
if (proxyConfig.getLogin() != null && proxyConfig.getPassword() != null) {
proxy.setSocksUsername(proxyConfig.getLogin());
proxy.setSocksPassword(proxyConfig.getPassword());
}
if (proxyConfig.getExclude() != null) {
proxy.setNoProxy(proxyConfig.getExclude().replace(";", ","));
}
}
return proxy;
}
内容来源于网络,如有侵权,请联系作者删除!