在使用selenium時,遇到如圖:
解決方案:
添加options參數:
#!/usr/bin/env python # -*- coding: utf-8 -*-
__author__ = 'tian'
__data__ = '2021/2/24 17:06'
import time from selenium import webdriver # 添加options參數
options = webdriver.ChromeOptions() options.add_argument("--ignore-certificate-errors") driver = webdriver.Chrome(options=options) driver.maximize_window() try: driver.get("https://mail.jjl.cn/owa/") time.sleep(2) except Exception as error: print("報錯信息:{0}".format(error)) finally: time.sleep(10) driver.quit()