ruby - 如何使用 Selenium 检测 SSL 证书信息?
问题描述
我正在使用 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 证书的任何信息一无所知。
解决方案
看看这个可能会有所帮助。
添加 Chrome 性能日志记录Network.responseReceived
事件,我们可以从中获取有关 Network.Response 中的安全详细信息的信息。
参考:https ://chromedevtools.github.io/devtools-protocol/tot/Network/#type-Response
推荐阅读
- ios - 拖动后保存数组中每个按钮的位置
- javascript - sequelize group by fn count 变得未定义
- python - 提取在 pandas 中不浮动的 DataFrame 的索引值
- oracle - 当按钮按下oracle表单时字段变为空?
- javascript - 如何使用 JavaScript 从交换服务器获取电子邮件内容为 EML 或 MSG?
- node.js - 渲染未加载请求页面的把手
- python-3.x - 如何在python3上打印无行
- ios - CocoaPod - 未设置版本时抛出错误
- javascript - 用 'var' 替换 'let' 而不改变代码逻辑
- java - 直到下一个大写字母 IntellIJ/Android Studio 的选择快捷方式