當前我們遇到這樣的問題,就要通過代碼的層面去解決
requests的話verify參數設置為False
selenium的話添加參數:--ignore-certificate-errors
測試代碼:
關於跑完自動化用例,會自動關閉瀏覽器的解決方法
#加啟動配置 option = webdriver.ChromeOptions() #關閉“chrome正受到自動測試軟件的控制” #V75以及以下版本 #option.add_argument('disable-infobars') #V76以及以上版本 option.add_experimental_option('useAutomationExtension', False) option.add_experimental_option('excludeSwitches', ['enable-automation']) #不自動關閉瀏覽器 option.add_experimental_option("detach", True) # 打開chrome瀏覽器 driver = webdriver.Chrome(chrome_options=option) return driver