1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] python 3.10 can't set proxy HTTP/HTTPS on selenium 4

Discussão em 'Python' iniciado por Stack, Setembro 28, 2024 às 10:13.

  1. Stack

    Stack Membro Participativo

    selenium 4.2.0
    python 3.10.4


    Having issue while trying to set up proxy on gecko driver Firefox using python Tried with

    from selenium.webdriver import Firefox
    from selenium import webdriver
    from selenium.webdriver.firefox.service import Service
    from selenium.webdriver.firefox.options import Options

    profile_path = r'C:\Users\Hodzi\AppData\Local\Mozilla\Firefox\Profiles\dzwrop1t.default-release'
    options=Options()
    options.set_preference('profile', profile_path)
    options.set_preference('network.proxy.type',1)
    options.set_preference('network.proxy.http', '154.30.216.64')
    options.set_preference('network.proxy.http_port', 8800)

    service = Service()
    driver = Firefox(service=service, options=options)
    driver.get("https://www.whatismyip.com/")
    driver.quit()


    Output: My regular IP address

    In settings I see this.

    [​IMG]

    If I manually check "Also use this proxy for HTTPS!" then it works.

    Is it possible to check or set this proxy through code also ?

    Continue reading...

Compartilhe esta Página