Is there a way to close this alert? I tried using drier.switch_to_alert().dismiss() but it doesn't work.
Error:
Traceback (most recent call last):
File "main.py", line 18, in <module>
driver.find_element(By.NAME,"nickname").send_keys(username+str(x)+Keys.ENTER)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 1244, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 424, in execute
self.error_handler.check_response(response)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 246, in check_response
raise exception_class(message, screen, stacktrace, alert_text) # type: ignore[call-arg] # mypy is not smart enough here
selenium.common.exceptions.UnexpectedAlertPresentException: Alert Text: {Alert text :
Message: unexpected alert open: {Alert text : }
(Session info: chrome=91.0.4472.101)
Stacktrace:
#0 0x55917d605919 <unknown>
Code:
for x in range(bots):
driver.get('https://kahoot.it?pin='+gamepin)
driver.find_element(By.NAME,"nickname").send_keys(username+str(x)+Keys.ENTER)