0
proxy_info = Proxy().Thailand1()

proxy = {
    'proxy': {
        'http': f'{proxy_info.type}://{proxy_info.username}:{proxy_info.password}@{proxy_info.hostname}:{proxy_info.port}',
        'https': f'{proxy_info.type}://{proxy_info.username}:{proxy_info.password}@{proxy_info.hostname}:{proxy_info.port}',
        'no_proxy': 'localhost,127.0.0.1'
    },
}

options = webdriver.ChromeOptions()
options.add_argument("--log-level=3")
options.add_argument('--no-sandbox')
options.add_argument("--ignore-certificate-errors")
options.add_argument('--ignore-certificate-errors-spki-list')
options.add_argument('--ignore-ssl-errors')
options.add_argument(f"user-agent={useragent}")

driver = webdriver.Chrome(seleniumwire_options=proxy, options=options, executable_path=chromedriver)
driver.implicitly_wait(5)
driver.get(url)

Проверял я прокси через Proxifier с включенной настройкой resolve hostname through proxy и утечек DNS не было Настройка DNS у Proxifier. Но используя seleniumwire сайты видят мой настоящий DNSВидно мой настоящий DNS, но с прокси. Как исправить?

1 ответ 1

0

Нашел ответ - Use socks5h when you want DNS resolution to happen on the proxy server rather than on the client. Нужно вместо socks5:// написать socks5h://

    proxy = {
    'proxy': {
        'http': f'{proxy_info.type}h://{proxy_info.username}:{proxy_info.password}@{proxy_info.hostname}:{proxy_info.port}',
        'https': f'{proxy_info.type}h://{proxy_info.username}:{proxy_info.password}@{proxy_info.hostname}:{proxy_info.port}',
        'no_proxy': 'localhost,127.0.0.1'
    },
}

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.