Python Windows身份验证用户名和密码不起作用
from selenium import webdriverfrom selenium.webdriver.common.action_chains import ActionChainsfrom selenium.webdriver.common.keys import Keysimport time driver = webdriver.Firefox()url = "http://the-internet.herokuapp.com/basic_auth"driver.get(url)time.sleep(5)alert = driver.switch_to.alert alert.authenticate('admin','admin')time.sleep(4)alert.accept()
ActionChains(driver).send_keys("admin").send_keys(Keys.TAB).send_keys("admin").perform()
相关分类