6

I am using:

  • Selenium 4
  • python 3.7
  • Firefox webdriver

I need to verify the username and password for my current project. I've been working day and night for days and I can't solve this problem. I've found a few extension on the internet, but it's from '13 year and I guess that's why it doesn't work. You can also see other methods I've tried below.

But doesn't work, because Proxy Authentication is not working anymore due to the Selenium bug..

alert_popup = browser.switch_to_alert() alert_popup.send_keys( "{username}{tab}{password}{tab}".format( username=proxy_username, tab=Keys.TAB, password=proxy_password ) ) alert_popup.accept() 

I wanted to create a profile and save the proxy information manually and start selenium with that profile. However, firefox does not allow user name and password to be entered manually.

2
  • 1
    Apparently selenium wire can do proxy auth, I'm not sure if I trust it though.CommentedOct 19, 2019 at 0:08
  • 1
    That's great! You might want to post an answer with how you did it for the next person.CommentedOct 19, 2019 at 13:57

1 Answer 1

2

To use proxies with auth in python selenium you can use seleniumwire.

Fistly, install it with pip install selenium-wire

Then import webdriver from seleniumwire instead selenium

Check the original Answer here

 from seleniumwire import webdriver options = { 'proxy': { 'http': 'http://username:password@host:port', 'https': 'https://username:password@host:port', 'no_proxy': 'localhost,127.0.0.1' # excludes } } browser = webdriver.Chrome(path_to_driver, seleniumwire_options=options) 
1
  • 4
    after alot of time searching why selenium is being very slow to load a page (15 sec) it turned out the problem was from seleniumwire, if your operation is time sensitive look for another solutionCommentedJan 26, 2021 at 8:28

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.