Hi, I am using selenium 4.8.2 with python.
I want to block popup window. but, all the ways i found on google didn't work...
Can you guess what the problem is?
below is my code...
def chrome_driver_dev():
options = webdriver.ChromeOptions()
# options.add_argument('--headless')
# options.add_argument('--no-sandbox')
# options.add_argument("--start-maximized")
# options.add_argument('--disable-dev-shm-usage')
options.add_argument("--disable-popup-blocking")
options.add_argument("--disable-notifications")
service = Service('chromedriver')
capabilities = webdriver.DesiredCapabilities.CHROME
capabilities["chromeOptions"] = {}
capabilities["chromeOptions"]["excludeSwitches"] = ["disable-popup-blocking"]
return webdriver.Chrome(service=service, desired_capabilities=capabilities, options=options)