I want to fetch the certificate details of the webpage seen in chrome browser. Details such as:
- Issued to
- Issued by
- Validity
I am unsure how to proceed further or where to look for the certificate. I tried to look for the same in network request but I suppose certificate details are not stored in network requests. I tried the below code:
from seleniumwire import webdriver
import pytest
from selenium.webdriver.chrome.options import Options
import time
import allure
class Test_main():
@pytest.fixture()
def test_setup(self):
# initiating browser
chrome_options = Options()
chrome_options.binary_location=\
r"C:\Users\libin.thomas\AppData\Local\Google\Chrome\Application\chrome.exe"
chrome_options.add_argument('--start-maximized')
chrome_options.add_argument('--headless')
self.driver = webdriver.Chrome(executable_path=r"D:/Python/Sel_python/drivers/chromedriverv86/chromedriver.exe",options=chrome_options)
# terminate script
yield
self.driver.close()
self.driver.quit()
print("Test completed")
@allure.severity(allure.severity_level.BLOCKER)
def testcase_01(self, test_setup):
self.driver.get("https://lifesciences.cactusglobal.com/")
title = self.driver.title
print("Page title: "+title)
#Capturing network requests
for request in self.driver.requests:
if request.response:
print(
request.url,
request.response.status_code,
request.response.headers
)
Is there anyway I can get details of SSL certificate using selenium or any Pypi package?