Selenium Ip Address Changing Code Not Working
I Am Trying to Make Selenium Change a Ip Address but It Isn't Working. the Ip Addresses Are Taken from Const {Builder, By, Key, Until} =...
I am trying to make selenium change a ip address but it isn't working. The ip addresses are taken from
const {Builder, By, Key, until} = require('selenium-webdriver');
const proxies = [
"47.243.167.134 :8889",
"154.236.179.233:1976",
"200.105.215.22:33630",
];
async function changeIP() {
const proxy = proxies[Math.floor(Math.random() * proxies.length)];
const capabilities = {
'browserName': 'chrome',
'chromeOptions': {
'args': [`--proxy-server=
}
};
const driver = await new Builder().withCapabilities(capabilities).build();
await driver.get("");
}
changeIP();
1 Answer
Free proxies usually don't work or areextremely slow and unsecure.
For thet reason, you might consider using some cheap proxies.
Also, after changing the proxies, you need to restart the driver for an effect.