How to handle the error popup on site security certificate is not trusted with chrome selenium python automation

How to handle the error popup on site security certificate is not trusted with chrome selenium python automation

For Chrome, add –ignore-certificate-errors in following code
options = webdriver.ChromeOptions()
options.add_argument(‘–ignore-certificate-errors’)
driver = webdriver.Chrome(chrome_options=options)
driver.get(‘URL’)

For the Internet Explorer, set acceptSslCerts desired capability as true:
capabilities = webdriver.DesiredCapabilities().INTERNETEXPLORER
capabilities[‘acceptSslCerts’] = True
driver = webdriver.Ie(capabilities=capabilities)
driver.get(‘URL’)

For Firefox, set accept_untrusted_certs as true

profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
driver = webdriver.Firefox(firefox_profile=profile)
driver.get(‘URL’)