c# - Firefox webdriver with socks aren't work. What's wrong? -
i have trubs code. bought list of proxy. name "list of socks 4/5 proxies binding ip address" , everyhour update. so, take first line txt file, paste code, isn't work! code is:
firefoxprofile profile = new firefoxprofile(); profile.setpreference("network.proxy.socks", "46.161.62.165"); profile.setpreference("network.proxy.socks_port", 1085); profile.setpreference("network.proxy.type", 1); // used set proxy configuration manual, after firefox considers //proxy set above firefoxdriver driver = new firefoxdriver(profile); driver.navigate().gotourl(@"http://whatismyipaddress.com");
also tried way:
firefoxprofile profile = new firefoxprofile(); string proxy = "46.161.62.165:1080"; openqa.selenium.proxy proxy = new openqa.selenium.proxy(); proxy.socksproxy = proxy; profile.setproxypreferences(proxy); int timeoutseconds = 1800; firefoxdriver driver = new firefoxdriver(new firefoxbinary(), profile, new timespan(0, 0, 0, timeoutseconds)); driver.navigate().gotourl(@"http://whatismyipaddress.com");
but doesn't work. please, me. interesting fact: proxy real , it's should work. have lists. there are:
list of http/https proxies authentication password: txt csv list of socks 4/5 proxies authentication password: txt csv list of http/https proxies binding ip address: txt csv list of socks 4/5 proxies binding ip address:
how can login , password? , everyone. peace.
i haven't used socks, think should this:
private firefoxdriver _createfirefoxdriver(string socksproxy) { if (string.isnullorempty(socksproxy)) { return new firefoxdriver(); } var caps = new desiredcapabilities(); caps.setcapability(capabilitytype.proxy, new proxy { socksproxy = socksproxy }); return new firefoxdriver(caps); }
Comments
Post a Comment