acceptInsecureCerts - WebDriver 编辑
The acceptInsecureCerts
capability communicates whether expired or invalid TLS certificates are checked when navigating. When the capability is false, an insecure certificate error will be returned as navigation encounters domains with certificate problems. Otherwise, self-signed or otherwise invalid certificates will be implicitly trusted by the browser on navigation. The capability has effect for the lifetime of the session.
Example
Using the acceptInsecureCerts
capability you can bypass, or implicitly trust, TLS certificates that the certificate service in the browser does not trust:
from selenium import webdriver from selenium.common import exceptions session = webdriver.Firefox(capabilities={"acceptInsecureCerts": True}) session.get("https://self-signed.badssl.com/") print(session.current_url)
Output:
https://self-signed.badssl.com/
See also
- List of WebDriver capabilities
- Navigate To command
- New Session command
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论