Python selenium chromedirver( headerless) use proxies( IPV6 ) with Authentication
you can create simple extension to set proxy and handle the authorization
manifest.json
{
"manifest_version": 2,
"name": "Chrome Proxy Auth",
"version": "1.0.0",
"permissions": [
"proxy",
"tabs",
"unlimitedStorage",
"storage",
"<all_urls>",
"webRequest",
"webRequestBlocking"
],
"background": {
"scripts": ["background.js"]
}
}
background.js edit host, port, username, password
var config = {
mode: "fixed_servers",
rules: {
singleProxy: {
host: "XXX.XXX.XXX.XXX",
port: parseInt(8888)
}
}
};
chrome.proxy.settings.set({
value: config,
scope: "regular"
}, function() {});
function callbackFunc(details) {
return {
authCredentials: {
username: "............",
password: "............"
}
};
}
chrome.webRequest.onAuthRequired.addListener(
callbackFunc, {
urls: ["<all_urls>"]
},
['blocking']
);
add both file to .zip
archive then in your python script
options = Options()
options.add_extension('/path/top/extension.zip')
driver = webdriver.Chrome(options=options)