how can i remove notifications and alerts from browser? selenium python 2.7.7

You can disable the browser notifications, using chrome options. Sample code below:

chrome_options = webdriver.ChromeOptions()
prefs = {"profile.default_content_setting_values.notifications" : 2}
chrome_options.add_experimental_option("prefs",prefs)
driver = webdriver.Chrome(chrome_options=chrome_options)

Leave a Comment