- [TestMethod]
- public void ChromOptions()
- {
- string[] proxies = { "206.198.131.142:80", "51.81.112.164:5836" };
- for (int i = 0; i < proxies.Length; i++)
- {
- ChromeOptions options = new ChromeOptions();
- options.AddArguments("--proxy-server="+proxies[i]+"");
- driver = new ChromeDriver(@"C:\ChromeDriver1\", options);
- driver.Navigate().GoToUrl("https://whatismyipaddress.com/");
- }
- }
Above is a C# code to switch your browser IP.
At line 5 you have to give a list of working proxy IP and the PORT list as an array.
Thats it.
No comments:
Post a Comment