import time

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select

driver = webdriver.Chrome(executable_path="C:\Program Files\Driver\chromedriver.exe")
driver.maximize_window()


driver.get("https://testautomationpractice.blogspot.com/")

clickme= driver.find_element_by_xpath('//*[@id="HTML9"]/div[1]/button').click()
time.sleep(5)

#driver.switch_to_alert().accept()#To close by using ok button

#to discard popup window

driver.switch_to_alert().dismiss()#To dismiss alert box

driver.close()

1c9330719b0f33b7bf9b1667bf8f7d7a529560b3
<mask token>

<mask token>
driver.maximize_window()
driver.get('https://testautomationpractice.blogspot.com/')
<mask token>
time.sleep(5)
driver.switch_to_alert().dismiss()
driver.close()

<mask token>
driver = webdriver.Chrome(executable_path=
    'C:\\Program Files\\Driver\\chromedriver.exe')
driver.maximize_window()
driver.get('https://testautomationpractice.blogspot.com/')
clickme = driver.find_element_by_xpath('//*[@id="HTML9"]/div[1]/button').click(
    )
time.sleep(5)
driver.switch_to_alert().dismiss()
driver.close()

import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
driver = webdriver.Chrome(executable_path=
    'C:\\Program Files\\Driver\\chromedriver.exe')
driver.maximize_window()
driver.get('https://testautomationpractice.blogspot.com/')
clickme = driver.find_element_by_xpath('//*[@id="HTML9"]/div[1]/button').click(
    )
time.sleep(5)
driver.switch_to_alert().dismiss()
driver.close()

import time

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select

driver = webdriver.Chrome(executable_path="C:\Program Files\Driver\chromedriver.exe")
driver.maximize_window()


driver.get("https://testautomationpractice.blogspot.com/")

clickme= driver.find_element_by_xpath('//*[@id="HTML9"]/div[1]/button').click()
time.sleep(5)

#driver.switch_to_alert().accept()#To close by using ok button

#to discard popup window

driver.switch_to_alert().dismiss()#To dismiss alert box

driver.close()
