1
在this question給出瞭如何使用Selenium WebDriver使用Java來處理身份驗證彈出窗口的答案。現在,這可以用於python嗎?它看起來像Python驅動程序沒有像Java掛件一樣的UserAndPassword
類。如何使用python處理Selenium WebDriver的身份驗證彈出窗口?
這是我曾嘗試:
wait = WebDriverWait(driver, 10)
alert = wait.until(ExpectedConditions.alertIsPresent())
alert.authenticateUsing(UserAndPassword("user","passwd"))
不行不行。我想我提出的身份驗證框不是'提醒',而是其他的東西。所以,警報永遠不會出現。但一盒是。請參閱http://stackoverflow.com/questions/36789858/how-to-fill-fields-in-a-popup-when-opening-a-sharepoint-website-with-selenium-us以查看此框的外觀... – Alex