Reputation: 11
Already tried following methods,
1) https://username:[email protected]
My username contains '\' thats why it is giving problem.
2) switch to alert method In this I am getting 'No alert' Exception
Please help in these cases/ Suggest any other method to handle windows authentication with python...
Upvotes: 1
Views: 2034
Reputation: 1403
Install win32com.client and then try the below code
from selenium import webdriver
import time
import win32com.client
driver=webdriver.Firefox()
driver.maximize_window()
driver.get('url')
shell = win32com.client.Dispatch("WScript.Shell")
shell.Sendkeys("username")
shell.Sendkeys("{TAB}")
shell.Sendkeys("password")
shell.Sendkeys("{ENTER}")
time.sleep(5)
driver.quit()
Upvotes: 2