-1
When clicking a button, an alert is issued asking me to confirm, it turns out that I already tried using Pynput to confirm with ENTER Key.press. But it didn’t work. The alert is in another window, so Lenium doesn’t see it
When inspecting the button, there is a HREF code with another link, which I cannot directly click on. So the solution would be to pass with a ENTER, but I could not with PYNPUT, any idea? My code below
browser = Chrome()
wdw = WebDriverWait(browser,10)
browser.get('https://sso.acesso.gov.br/login?client_id=cav.receita.fazenda.gov.br')
browser.implicitly_wait(15)
browser.find_element_by_xpath('//*[@id="login-dados-certificado"]/p[2]/a/img').click()
browser.find_element_by_xpath('//*[@id="cert-digital"]/a').click()
wdw.until(
new_window_is_opened(browser.window_handles)
)
browser.switch_to_window(
browser.window_handles[-1]
)
browser.switch_to_alert
Welcome to Stack Overflow! You have placed an image of the code. Although it seems like a good idea, it is not! One of the reasons is that for the author of the question to test it cannot copy the code and change something inside. Click the edit link and put the code/error as text.
– Leticia Rosa