Firefoxの場合、accept_untrusted_certs FirefoxProfile()オプションをTrue次のように設定する必要があります。
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
driver = webdriver.Firefox(firefox_profile=profile)
driver.get('https://cacert.org/')
driver.close()
Chromeの場合、引数を追加する必要があります。--ignore-certificate-errors ChromeOptions()
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('ignore-certificate-errors')
driver = webdriver.Chrome(chrome_options=options)
driver.get('https://cacert.org/')
driver.close()
Internet Explorerの場合、必要acceptSslCertsな機能を設定する必要があります。
from selenium import webdriver
capabilities = webdriver.DesiredCapabilities().INTERNETEXPLORER
capabilities['acceptSslCerts'] = True
driver = webdriver.Ie(capabilities=capabilities)
driver.get('https://cacert.org/')
driver.close()
実際には、によるとDesired Capabilitiesドキュメンテーション、設定acceptSslCertsする機能True、それは一般的な読み取り/書き込み機能であるため、すべてのブラウザで動作するはずですが。
  acceptSslCerts
  
  ブール値
  
  セッションがデフォルトですべてのSSL証明書を受け入れる必要があるかどうか。
Firefoxの作業デモ:
>>> from selenium import webdriver
設定acceptSslCertsしますFalse:
>>> capabilities = webdriver.DesiredCapabilities().FIREFOX
>>> capabilities['acceptSslCerts'] = False
>>> driver = webdriver.Firefox(capabilities=capabilities)
>>> driver.get('https://cacert.org/')
>>> print(driver.title)
Untrusted Connection
>>> driver.close()
設定acceptSslCertsしますTrue:
>>> capabilities = webdriver.DesiredCapabilities().FIREFOX
>>> capabilities['acceptSslCerts'] = True
>>> driver = webdriver.Firefox(capabilities=capabilities)
>>> driver.get('https://cacert.org/')
>>> print(driver.title)
Welcome to CAcert.org
>>> driver.close()