Handling window pop up with selenium : <p>I am currently working on a bot that logs into instagram, I currently have the script to log in and turn on notifications but when then I get a window pop the code does not click on allow. I have been stuck for quite some time. Thank you in advance for your help. <a href="https://i.stack.imgur.com/M1P9L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M1P9L.png" alt="Window Popup"></a></p>

<pre><code>def allow_noti():
allow_noti = WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.XPATH, 
"//button[contains(.,'Turn On')]")))
allow_noti.click()
allow_browser =  WebDriverWait(browser, 10).until(EC.element_to_be_clickable((By.XPATH, '//* 
[text()="Allow"]'))).click()
allow_browser.click()
</code></pre>
