Для прокси использовал
seleniumwire
from seleniumwire import webdriver
from fake_useragent import UserAgent
from selenium.webdriver import FirefoxProfile
seleniumwire_options = {
'proxy': {
'http': f'http://'
f'{proxy_data["username"]}:{proxy_data["password"]}@'
f'{proxy_data["proxy_address"]}:{proxy_data["ports"]["socks5"]}',
'https': f'https://'
f'{proxy_data["username"]}:{proxy_data["password"]}@'
f'{proxy_data["proxy_address"]}:{proxy_data["ports"]["socks5"]}',
'no_proxy': 'localhost,127.0.0.1,dev_server:8080'
}
}
profile = FirefoxProfile()
user_agent = UserAgent().random
profile.set_preference("general.useragent.override", user_agent)
options = Options()
options.add_argument('--headless')
driver = webdriver.Firefox(
firefox_profile=profile,
options=options,
seleniumwire_options=seleniumwire_options
)
driver.get('http://<your_url>')