I am using selenium to take a screenshot of the website. One problem I need to solve is to turn off the page popup before selenium manipulates the image. Is there any way to automatically turn off the popup before the picture is taken without searching for the name of the popup?
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument("--allow-no-sandbox-job")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--disable-notifications")
chrome_options.add_argument("--disable-popup-blocking")
chrome_options.add_argument("--disable-infobars")
chrome_options.add_argument('--hide-scrollbars')
chrome_options.add_argument("--disable-extensions")