Here is the code for Selenium 4.x, to enable the proxy, you need to set browser options, these parameters from the bottom (ssl is https), and the rest is clear from the names, in order to find out these parameters, I went into the browser config and manually checked what to pick up.
I also know how to remove the bot check in the driver, for this you need to compile your driver on rast
def main():
url = "https://2ip.ru/"
options = Options()
options.set_preference("network.proxy.type", 1)
options.binary_location = r"C:\Program Files\Mozilla Firefox\firefox.exe"
options.set_preference("network.proxy.http", "xx.xxx.xxx.xxxx")
options.set_preference("network.proxy.http_port", 8000)
options.set_preference("network.proxy.ssl", "xx.xxx.xxx.xxx")
options.set_preference("network.proxy.ssl_port", 8000)
serviceDriver = Service(
executable_path=r"C:\Users\User\PycharmProjects\driver\geckodriver.exe")
driver = webdriver.Firefox(options=options, service=serviceDriver)
driver.get("https://2ip.ru")
http:
orhttps:
? – Kimberlykimberlyn