I am creating a script that crawls one website to gather some data but the problem is that they blocked me after too many requests but using a proxy I can send more request then currently I do. I have integrated proxy with chrome option --proxy-server
options.add_argument('--proxy-server={}'.format('http://ip:port'))
but I am using a paid proxy so it requires authentication and as below screenshot it gives the alert box for username and password
Then I tried to use it with username and password
options.add_argument('--proxy-server={}'.format('http://username:password@ip:port'))
But it also does not seems to work. I was looking for a solution and found below solution and I used it with the chrome extension proxy auto auth and without the chrome extension
proxy = {'address': settings.PROXY,
'username': settings.PROXY_USER,
'password': settings.PROXY_PASSWORD}
capabilities = dict(DesiredCapabilities.CHROME)
capabilities['proxy'] = {'proxyType': 'MANUAL',
'httpProxy': proxy['address'],
'ftpProxy': proxy['address'],
'sslProxy': proxy['address'],
'noProxy': '',
'class': "org.openqa.selenium.Proxy",
'autodetect': False,
'socksUsername': proxy['username'],
'socksPassword': proxy['password']}
options.add_extension(os.path.join(settings.DIR, "extension_2_0.crx")) # proxy auth extension
but neither of above worked properly it seems working because after above code the proxy authentication alert disappeared and when I checked my IP by googling what is my IP and confirmed that is not working.
please anyone who can help me to authenticate the proxy server on chromedriver.