In the documentation, I read that for using proxy set while building driver like this:
var driver = new webdriver.Builder()
.withCapabilities(webdriver.Capabilities.chrome())
.setProxy(proxy.manual({http: 'host:1234'}))
.build();
When I use this code with proxy '103.87.16.2:80' - .setProxy(proxy.manual({http: 'host:1234'}))
, I still have my home IP.
What is the problem?
In the documentation, I read that for using proxy set while building driver like this:
var driver = new webdriver.Builder()
.withCapabilities(webdriver.Capabilities.chrome())
.setProxy(proxy.manual({http: 'host:1234'}))
.build();
When I use this code with proxy '103.87.16.2:80' - .setProxy(proxy.manual({http: 'host:1234'}))
, I still have my home IP.
What is the problem?
Share Improve this question edited Mar 18, 2018 at 20:02 Omar Einea 2,5227 gold badges24 silver badges36 bronze badges asked Mar 18, 2018 at 19:37 chosiraichosirai 1931 gold badge3 silver badges7 bronze badges 1- The proxy works as expected. How are you determining the IP address in use? Also, please have a look at stackoverflow./questions/11450158/… and sites.google./a/chromium/chromedriver/capabilities – rollstuhlfahrer Commented Mar 25, 2018 at 20:13
1 Answer
Reset to default 3const { Builder } = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');
let proxyAddress = '212.56.139.253:80'
// Setting the proxy-server option is needed to info chrome to use proxy
let option = new chrome.Options().addArguments(`--proxy-server=http://${proxyAddress}`)
const driver = new Builder()
.forBrowser('chrome')
.setChromeOptions(option)
.build()
driver.get('http://whatismyip.host/')
.then(() => console.log('DONE'))