Проблема с подключением прокси: _request() got an unexpected keyword argument 'proxies'
пытаюсь сделать get запрос, но получаю ошибку:
_request() got an unexpected keyword argument 'proxies'
proxies = {'https' : 'socks5://ЛОГ:ПАС@ИП:ПОРТ'}
print(proxies)
async with session.get(f'https://{link}',proxies=proxies) as r:
print('ok')
Сессию получаю из предыдущего запроса:
async with aiohttp.ClientSession(headers=headers,connector=connector,timeout=timeout) as session:
Получаю ошибку: _request() got an unexpected keyword argument 'proxies'
В чём проблема?
Пробовал также подключать connector: _request() got an unexpected keyword argument 'connector'
Ответы (2 шт):
Автор решения: Сергей Шашко
→ Ссылка
Документайию внимательно читаем. https://docs.aiohttp.org/en/stable/client_advanced.html?highlight=session.get#proxy-support
Автор решения: pshpth_ sht
→ Ссылка
Оригинальный ответ из документации
async with aiohttp.ClientSession() as session:
proxy_auth = aiohttp.BasicAuth('user', 'pass')
async with session.get("http://python.org",
proxy="http://proxy.com",
proxy_auth=proxy_auth) as resp:
print(resp.status)