我想使用python3selenium访问一个网站。但是,为了访问我的目标网站,我必须通过和认证页面。在
以下是页面示例:
如上图所示,我必须:填充用户名
填充密码
单击“登录”
尝试了以下代码,但不起作用。在browser = webdriver.Chrome('path_to_exe')
wait = WebDriverWait(browser, 600)
browser.get('https://target_website.com')
wait.until(EC.alert_is_present())
browser.get('https://:@example.example.com/ab/cd/ef')
尝试了下面的代码,仍然不起作用。在
^{pr2}$
最后,我尝试了下面的代码,但还是没用。在browser = webdriver.Chrome('path_to_exe')
wait = WebDriverWait(browser, 600)
browser.get('https://target_website.com')
wait.until(EC.alert_is_present())
alert = browser.switch_to_alert()
alert.authenticate('', '')
alert.accept()