[Python] how to use proxy in selenium 4.1

Discussão em 'Python' iniciado por Stack, Setembro 26, 2024.

  1. Stack

    Stack Membro Participativo

    i am trying to make an automation project which will use proxy to register in a site. but i am unable to get it work.

    I have tried selenium-wire for proxy authentication still it doesn't work

    from seleniumwire import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.firefox.options import Options
    import os
    import keyboard
    import pyautogui
    from time import sleep


    user = 'jesbeqki'
    pwd = '1wbt8dnqtu8w'
    end = '2.56.119.93:5074'

    seleniumwire_options ={
    "proxies" : {
    "https": "http://"f"{user}:{pwd}@{end}/",
    "http": "http://"f"{user}:{pwd}@{end}/",
    'verify_ssl': False
    }
    }
    firefox_options = Options()
    # firefox_options.add_argument("--headless")
    driver = webdriver.Firefox(options=firefox_options, seleniumwire_options=seleniumwire_options)

    driver.get('https://httpbin.org/ip')

    text = driver.find_element(By.TAG_NAME, 'body').text
    print(text)


    it's showing my original ip.

    Continue reading...

Compartilhe esta Página