T
T
tofel2020-07-08 09:41:09
Python
tofel, 2020-07-08 09:41:09

Python selenium proxy?

Hello. A question.
At work, when accessing the site through a browser, you need to enter the login password for the proxy. The picture is below.
I tried to get around it all in this way but it does not work. Maybe someone will tell you a working way.
I am new to python and selenium.

from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType
from pywinauto.keyboard import send_keys



profile = webdriver.FirefoxProfile()
myProxy = "login:[email protected]:8080"

proxy = Proxy({
    'proxyType': ProxyType.MANUAL,
    'httpProxy': myProxy,
    'ftpProxy': myProxy,
    'sslProxy': myProxy,
    'noProxy': '' # set this value as desired
    })

profile.set_preference("general.useragent.override", "Mozilla/5.0 (Android 10; Mobile; rv:75.0) Gecko/75.0 Firefox/75.0")
browser = webdriver.Firefox(proxy=proxy,firefox_profile=profile,executable_path=r'C:\\Files\\geckodriver.exe')
browser.implicitly_wait(5)
browser.get('https://www.instagram.com/')

5f05698fec9d7695692784.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question