Ozietra adlı üyeden alıntı: mesajı görüntüle
https://www.csharpegitimi.com.tr/202...y-kullanm.html

Buradaki EBS Proxy engelleniyor chrome tarafından bir türlü proxy auth sağlayamadım yardımcı olabilecek varsa şimdiden teşekkür ederim.
import zipfile

def create_proxy_extension(proxy_host, proxy_port, proxy_user, proxy_pass, plugin_path):
    manifest_json = """
    {
        "version": "1.0.0",
        "manifest_version": 2,
        "name": "Proxy Extension",
        "permissions": [
            "proxy",
            "tabs",
            "unlimitedStorage",
            "storage",
            "<all_urls>",
            "webRequest",
            "webRequestBlocking"
        ],
        "background": {
            "scripts": ["background.js"]
        }
    }
    """

    background_js = f"""
    var config = {{
            mode: "fixed_servers",
            rules: {{
              singleProxy: {{
                scheme: "http",
                host: "{proxy_host}",
                port: parseInt({proxy_port})
              }},
              bypassList: ["localhost"]
            }}
          }};
    
    chrome.proxy.settings.set({{value: config, scope: "regular"}}, function() {{}});
    
    function callbackFn(details) {{
        return {{
            authCredentials: {{
                username: "{proxy_user}",
                password: "{proxy_pass}"
            }}
        }};
    }}
    
    chrome.webRequest.onAuthRequired.addListener(
                callbackFn,
                {{urls: ["<all_urls>"]}},
                ['blocking']
    );
    """

    with zipfile.ZipFile(plugin_path, 'w') as zp:
        zp.writestr("manifest.json", manifest_json)
        zp.writestr("background.js", background_js)
from seleniumwire import webdriver
from proxy_auth_plugin import create_proxy_extension

plugin_path = 'proxy_auth_plugin.zip'
create_proxy_extension("proxy_ip", "proxy_port", "proxy_user", "proxy_pass", plugin_path)

chrome_options = webdriver.ChromeOptions()
chrome_options.add_extension(plugin_path)

driver = webdriver.Chrome(seleniumwire_options={}, options=chrome_options)
driver.get("https://httpbin.org/ip")