如何使用Selenium检测SSL证书信息?

时间:2018-05-10 12:44:42

标签: ruby selenium selenium-webdriver

我使用Selenium收集一些数据,其中一个要求是获取SSL证书信息,如发行人,到期日,混合内容等。

Selenium有没有办法获取这些信息?

我正在使用Selenium和Ruby。

require 'selenium-webdriver'
options = Selenium::WebDriver::Chrome::Options.new(args: ['headless'])
driver = Selenium::WebDriver.for(:chrome, options: options)
driver.get 'https://stackoverflow.com/'

之后,我对如何获取SSL证书的任何信息毫无头绪。

1 个答案:

答案 0 :(得分:0)

只需看看this,这可能会有所帮助。

向其中添加Chrome性能日志记录Network.responseReceived事件,我们可以从中获取有关Network.Response中安全性详细信息的信息。

参考:https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-Response

相关问题